Simple. Signal-powered. Angular-first. Platform-agnostic.
Gehu is a modern state management ecosystem built around a flat, intuitive API, signal-based reactivity, and a platform-agnostic core. It is designed to provide the simplicity of Zustand while embracing Angular's signal ecosystem, zoneless applications, and SSR-first development.
The philosophy behind Gehu is straightforward:
- Build a tiny, framework-independent core.
- Provide first-class Angular integration.
- Keep tooling optional.
- Deliver excellent TypeScript inference.
- Maintain zero runtime dependencies.
- Optimize for performance, tree-shaking, and developer experience.
Most state management libraries force developers into one of two extremes:
- Too much boilerplate.
- Too much magic.
Gehu aims for the middle ground.
Instead of introducing new architectural concepts, Gehu keeps state management familiar:
- State lives in stores.
- Stores expose actions.
- Derived values are simple.
- Async operations are first-class.
- Tooling stays optional.
The result is a library that scales from small applications to enterprise systems without changing how developers think.
Gehu follows a few non-negotiable principles:
- Flat APIs over deeply nested configuration.
- Platform-agnostic core.
- Angular-first, not Angular-only.
- Zero runtime dependencies.
- SSR-safe by default.
- Zoneless-ready.
- Tree-shakable.
- ESM-first.
- Strong TypeScript inference.
- Optional tooling.
- Performance before convenience.
| Package | Current | Next | What | Size (gzip) |
|---|---|---|---|---|
@gehu-js/core |
platform-agnostic store engine, signals, resources, mutations, linked stores, plugin system | ~2–3 KB | ||
@gehu-js/angular |
provideGehu / injectStore, Angular signal adapter, SSR, zoneless |
~2.4 KB | ||
@gehu-js/react |
React hooks, provider scoping, SSR hydration helpers, server entry | ~2 KB | ||
@gehu-js/persist |
persistence plugin + storage adapters | ~1.2 KB | ||
@gehu-js/devtools |
event bridge (no UI) | ~0.9 KB | ||
@gehu-js/testing |
framework- & runner-agnostic test helpers | ~1.6 KB |
Start at docs/README.md:
- Getting started
- Core concepts · Resources · Mutations · Linked stores
- Angular · Zoneless · SSR
- Releasing · Release checklist
- Persistence · Devtools · Plugins · Testing
- Bundle size · Migration
examples/vanilla— counter, resources, persistence, devtools (run withbun)examples/angular-basic— CSRexamples/angular-zoneless— zoneless change detectionexamples/angular-ssr— server-side rendering + hydrationexamples/react-vite— React + Viteexamples/react-next— Next.js + SSR-friendly registry flowexamples/angular-ngrx-compat— migration-oriented ngrx compatibility example
bun install
bun run build # tsc -> ESM + d.ts for every package
bun run typecheck
bun run test:ci # all package tests, including React and Angular adapter suites
bun run release:pack-checkZero runtime dependencies · ESM-first · sideEffects: false · tree-shakable ·
no browser-only APIs in core · no global mutable stores on SSR · works in Bun,
Node, browser, SSR, and tests.
The Gehu core contains no Angular-specific logic.
It can run in:
- Browser
- Node.js
- Bun
- Server-side rendering
- Future framework adapters
Gehu provides a dedicated Angular adapter with:
- Dependency Injection support
- Signal integration
- Zoneless compatibility
- Angular SSR support
- Scoped stores
- Simple providers
Stores are intentionally simple.
const counterStore = createStore(
({ set, get, ctx }) => ({
count: 0,
double: () => get().count * 2,
increment: () =>
set(state => ({
count: state.count + 1,
})),
reset: () => ctx.reset(),
}),
{
name: "counter",
devtools: true,
}
);The API remains flat and easy to understand.
Coordinate multiple stores without tightly coupling them.
const checkoutStore = linkedStore(
{
cart: cartStore,
user: userStore,
},
({ stores }) => ({
canCheckout: () =>
stores.cart.items().length > 0 &&
!!stores.user.currentUser(),
})
);Manage asynchronous reads with first-class support.
const store = createStore(({ ctx }) => ({
users: ctx.resource({
name: "users",
fetch: () => api.users.list(),
}),
}));Resources expose:
- data
- loading
- error
- status
- refetch()
- clear()
Model asynchronous writes cleanly.
const store = createStore(({ ctx }) => ({
saveUser: ctx.mutation({
name: "saveUser",
run: api.saveUser,
}),
}));Mutations expose:
- loading
- error
- status
- reset()
Gehu is designed for modern server-side rendering.
Supports:
- Angular SSR
- React SSR / Next.js hydration flows
- Bun
- Node.js
- Browser hydration
- Per-request store instances
Built with modern Angular applications in mind.
Gehu works naturally with Angular's zoneless change detection model.
The API is designed to maximize inference and minimize explicit generics.
Most users should rarely need to specify types manually.
The runtime core intentionally avoids third-party runtime dependencies.
Benefits include:
- Smaller bundles
- Faster installs
- Better control over performance
- Easier long-term maintenance
@gehu-js/core
Platform-agnostic state engine
@gehu-js/angular
Angular integration
@gehu-js/react
React integration
@gehu-js/testing
Framework-agnostic testing utilities
@gehu-js/devtools
Runtime devtools bridge
@gehu-js/persist
Persistence adapters
gehu/
packages/
core/
angular/
react/
testing/
devtools/
persist/
examples/
docs/
tooling/
Gehu aims to become:
- The simplest signal based state management library for javascript.
- A reusable state engine for multiple frameworks.
- An excellent developer experience.
- Lightweight enough for small projects.
- Powerful enough for enterprise applications.
| Package | Target (gzip) |
|---|---|
| @gehu-js/core | 4–8 KB |
| @gehu-js/angular | 2–5 KB |
| @gehu-js/react | 2–4 KB |
| @gehu-js/testing | 2–4 KB |
| @gehu-js/devtools | 2–5 KB |
| @gehu-js/persist | 1–3 KB |
Overall runtime target:
Under 25 KB gzip
LGPL
🚧 Gehu is currently under active development.
The project is being built incrementally following a phased architecture with a strong focus on stability, performance, and developer experience.
Contributions, discussions, and feedback will be welcomed once the initial public release is available.
