Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Web Security TippsIntroducing the new Confluence integration with Google Chat(22.09.2026 um 19:40 Uhr)
Web Security TippsQuick notes in Take notes for me(22.09.2026 um 21:31 Uhr)
Sichere ProgrammierungSecurity improvements for SSH(22.09.2026 um 16:11 Uhr)
Sichere ProgrammierungKI-Akzeptanz: Wie Rewe digital einfach nur den Chatbot umbenannte(22.09.2026 um 18:00 Uhr)
Sichere ProgrammierungClaude Opus 5.5: Keeping safety ahead of capabilities(22.09.2026 um 20:59 Uhr)
Sichere ProgrammierungYour Terraform Monolith Isn't Too Big. It's Tightly Coupled.(22.09.2026 um 21:00 Uhr)
Sichere ProgrammierungMy PR got merged into Mike — OSS Legal AI Platform 🎉(22.09.2026 um 21:34 Uhr)
Sichere ProgrammierungStop Writing JavaScript To Fix `100vh` On Mobile(22.09.2026 um 21:35 Uhr)
Sichere ProgrammierungNext.js proxy.ts Explained (with Cheat Sheet)(22.09.2026 um 21:36 Uhr)
Web Security TippsIntroducing the new Confluence integration with Google Chat(22.09.2026 um 19:40 Uhr)
Web Security TippsQuick notes in Take notes for me(22.09.2026 um 21:31 Uhr)
Sichere ProgrammierungSecurity improvements for SSH(22.09.2026 um 16:11 Uhr)
Sichere ProgrammierungKI-Akzeptanz: Wie Rewe digital einfach nur den Chatbot umbenannte(22.09.2026 um 18:00 Uhr)
Sichere ProgrammierungClaude Opus 5.5: Keeping safety ahead of capabilities(22.09.2026 um 20:59 Uhr)
Sichere ProgrammierungYour Terraform Monolith Isn't Too Big. It's Tightly Coupled.(22.09.2026 um 21:00 Uhr)
Sichere ProgrammierungMy PR got merged into Mike — OSS Legal AI Platform 🎉(22.09.2026 um 21:34 Uhr)
Sichere ProgrammierungStop Writing JavaScript To Fix `100vh` On Mobile(22.09.2026 um 21:35 Uhr)
Sichere ProgrammierungNext.js proxy.ts Explained (with Cheat Sheet)(22.09.2026 um 21:36 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Eliminate 80% of Nuxt store boilerplate with a single createStore call

Every Nuxt app has the same problem. For every API resource — users, posts, products, orders — the same code gets written: Define a TypeScript interface Create reactive state (ref, reactive) Create a loading ref Create an error ref…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Every Nuxt app has the same problem.



For every API resource — users, posts, products, orders — the same code gets written:




  1. Define a TypeScript interface

  2. Create reactive state (ref, reactive)

  3. Create a loading ref

  4. Create an error ref

  5. Write a fetch function with try/catch/finally

  6. Repeat for create, update, delete

  7. Repeat for the next resource



Harlemify is an open-source Nuxt module by Diphyx that eliminates this repetition. It's built on top of Harlem, a powerful and extensible state management library for Vue 3 — so the reactive store layer is solid and battle-tested.






Define your data shape once, get everything else for free



Harlemify generates typed stores from Zod schemas. Here's what a full CRUD store looks like:




import { createStore, shape, ModelOneMode, ModelManyMode } from "@diphyx/harlemify/runtime";

const userShape = shape((factory) => {
return {
id: factory.number().meta({
identifier: true,
}),
name: factory.string(),
email: factory.email(),
};
});

export const userStore = createStore({
name: "users",
model({ one, many }) {
return {
current: one(userShape),
list: many(userShape),
};
},
view({ from }) {
return {
user: from("current"),
users: from("list"),
};
},
action({ api }) {
return {
list: api.get(
{
url: "/users",
},
{ model: "list", mode: ModelManyMode.SET },
),
get: api.get(
{
url: "/users/:id",
},
{ model: "current", mode: ModelOneMode.SET },
),
create: api.post(
{
url: "/users",
},
{ model: "list", mode: ModelManyMode.ADD },
),
delete: api.delete(
{
url: "/users/:id",
},
{ model: "list", mode: ModelManyMode.REMOVE },
),
};
},
});






No separate type definitions. No manual loading/error refs. No try/catch boilerplate.






What comes out of this single definition



Typed modelscurrent holds a single user, list holds a collection. Both are fully typed from the Zod shape.



Reactive viewsuser and users are computed refs that update whenever the underlying model changes. Powered by Harlem's reactive store engine under the hood.



API actions with auto-commit — Each action knows which model to update and how (SET replaces, ADD appends, REMOVE deletes by identifier).



Automatic status tracking — Every action exposes loading, error, and status without writing a single ref.






Using it in components






<script setup>
const { execute, loading, error } = useStoreAction(userStore, "list");
const { data: users } = useStoreView(userStore, "users");

await execute();
</script>

<template>
<p v-if="error">{{ error.message }}</p>
<ul v-else-if="!loading">
<li v-for="user in users" :key="user.id">{{ user.name }}</li>
</ul>
</template>






Three composables cover everything:





  • useStoreAction — execute actions, track loading/error/status


  • useStoreView — access reactive computed state


  • useStoreModel — mutate state directly (set, patch, add, remove, reset)






Beyond basic state management






Concurrency control



Every action can be configured with a concurrency strategy:





  • BLOCK — throw if the action is already running


  • SKIP — return the existing promise


  • CANCEL — abort the previous call, start a new one


  • ALLOW — run both in parallel



No more debouncing hacks or manual AbortController wiring.






Record collections



For grouped data (e.g., users by team), use record mode:




model({ many }) {
return {
byTeam: many(userShape, { kind: ModelManyKind.RECORD }),
};
},






This gives you { teamA: [...users], teamB: [...users] } with typed CRUD operations per key.






Handler actions



Not every action is an API call. Custom logic gets first-class support:




action({ handler }) {
return {
sortByName: handler(async ({ model }) => {
const sorted = [...model.list].sort((a, b) => a.name.localeCompare(b.name));
model.list = sorted;
}),
};
},






Handlers have full access to models and views, with the same status tracking as API actions.






SSR with automatic hydration



Harlemify uses Harlem's SSR plugin (@harlem/plugin-ssr) under the hood. Server-rendered state is automatically hydrated on the client — no manual transfer or serialization needed.






How it compares
















































Manual / Pinia Harlemify
Schema Separate TypeScript interfaces Zod shape — types + validation
API calls Manual fetch + state updates Declarative with auto-commit
Loading/error Manual refs per action Automatic per action
Concurrency Not built-in Block, Skip, Cancel, Allow
Collections Manual array management Built-in modes (SET, ADD, PATCH, REMOVE)
SSR Plugin required Built-in via Harlem SSR
Lines per resource ~50-60 ~15-20


Harlemify is not a Pinia replacement. Pinia is great for general-purpose client state. Harlemify is built on top of Harlem and optimized for API-driven data — the CRUD resources that make up 80% of most apps.






Try it






npm install @diphyx/harlemify









// nuxt.config.ts
export default defineNuxtConfig({
modules: ["@diphyx/harlemify"],
});








Feedback and contributions are welcome — star the repo if it's useful, or open an issue for anything that's missing.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Eliminate 80% of Nuxt store boilerplate with a single createStore call

Thematisch verwandte Begriffe: Eliminate, Nuxt, store, boilerplate · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-77259 | MCP Atlassian is a Model Context Protocol (MCP) server for Atlassian pro…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick