synapse-storage

Three independent tools
in a single library.

A state manager, a business logic layer and an API client — three independent tools in one library. Take exactly what you need.

GitHub
TypeScript-firstrxjs · react optionaltree-shakeable
Three independent blocks

Each block is a standalone module you can use on its own

You need only state

State Manager

Reactive storages with a unified API. No RxJS, no React — just state and subscriptions.

  • Memory · LocalStorage · IndexedDB under one interface
  • Immutable updates, Immer-style
  • Memoized selectors with cross-store dependencies
  • Subscriptions to changes out of the box
synapse-storage/core
You need a full solution

Business Logic Layer

A business logic layer on top of storage: actions, effects and module assembly. Shaped like NestJS services, but without a heavy DI container.

  • Dispatcher — actions and store updates
  • Effects on RxJS, Redux-Observable / NgRx Effects style
  • createSynapse — module assembly and wiring synapses together
  • React hooks, SSR (ssr: true) and hydration, ready-made recipes
synapse-storage/utils
You need only requests

API Client

A built-in HTTP client with smart caching — like RTK Query, but simpler.

  • Declarative, typed endpoints
  • Smart caching and invalidation
  • Cache can live in IndexedDB — survives reloads (unlike RTK Query)
  • Works standalone or inside effects
synapse-storage/api
Why Synapse

Flexibility without compromise

Framework agnostic

A pure-TypeScript core: works with any framework or none at all. rxjs and react are optional peer dependencies.

TypeScript-first

Strict typing and autocomplete across actions, selectors and effects. Types are inferred, not duplicated by hand.

A storage for any case

Memory, LocalStorage and IndexedDB under one IStorage interface — swap the implementation in a single line, painlessly.

Extensible via middleware

Ready-made middleware (batching, shallow-compare) plus your own — for optimization and intercepting storage operations.

Cross-tab sync

Broadcast state sharing between browser tabs out of the box — no third-party libraries.

SSR and Next.js

Server rendering via createSynapseCtx({ ssr: true }) with dehydrate/hydrate — content in HTML with no hydration mismatch.

Architecture

Two layers

The State Manager is responsible for where state lives, while the Business Logic Layer handles how logic drives it. Take only the layer you need.

Layer 1State Manager

where state lives

MemoryStorageLocalStorageIndexedDBStorageIStorageSelectors
Layer 2Business Logic Layer

how logic drives state

DispatcherEffectscreateSynapseReact-хуки

Take only what you need

One package, three independent tools. Start with the install and plug in your layer.

GitHub
SynapseMIT © 2026 synapse-storage