open-index/open-npm huggingface dataset:
npm package: @stateloom/angular
Description: Angular adapter for StateLoom -- bridges `Subscribable<T>` to Angular Signals and RxJS Observables with dependency injection and SSR scope support.
Latest version: 1.0.0-alpha.0

# @stateloom/angular

Angular adapter for StateLoom -- bridges `Subscribable<T>` to Angular Signals and RxJS Observables with dependency injection and SSR scope support.

## Install

```bash
pnpm add @stateloom/angular @stateloom/core
```

## Quick Start

```typescript
import { Component } from '@angular/core';
import { signal } from '@stateloom/core';
import { toAngularSignal } from '@stateloom/angular';

const count = signal(0);

@Component({
  selector: 'app-counter',
  template: `<span>{{ count() }}</span>`,
})
export class CounterComponent {
  readonly count = toAngularSignal(count);
}
```

## API

| Export                                           | Purpose                                           |
| ------------------------------------------------ | ------------------------------------------------- |
| `toAngularSignal(subscribable, options?)`        | Bridge `Subscribable<T>` to Angular `Signal<T>`   |
| `toObservable(subscribable)`                     | Bridge `Subscribable<T>` to RxJS `Observable<T>`  |
| `fromObservable(observable$, initialValue)`      | Bridge RxJS `Observable<T>` to `Subscribable<T>`  |
| `injectStore(store, selector?, options?)`        | Inject store as Angular `Signal<T>` with selector |
| `provideStateloomScope(scope)` / `injectScope()` | SSR scope via Angular DI                          |
| `STATELOOM_SCOPE`                                | Injection token for advanced usage                |

## Requirements

- Angular 17+
- RxJS 7+
- `@stateloom/core` (required peer dependency)
- `@stateloom/store` (optional peer dependency)

## Documentation

Full documentation with examples, API reference, patterns, and migration guides: [docs/api/angular](../../docs/api/angular/)

## License

MIT
npm package: @stateloom/atom
Description: Bottom-up atomic state composition for StateLoom. Familiar to Jotai users.
Latest version: 1.0.0-alpha.0

# @stateloom/atom

Bottom-up atomic state composition for StateLoom. Familiar to Jotai users.

## Install

```bash
pnpm add @stateloom/core @stateloom/atom
```

## Quick Start

```typescript
import { atom, derived } from '@stateloom/atom';

const countAtom = atom(0);
const doubledAtom = derived((get) => get(countAtom) * 2);

countAtom.set(5);
doubledAtom.get(); // 10
```

## Exports

| Export                      | Description                                   |
| --------------------------- | --------------------------------------------- |
| `atom(initialValue)`        | Create a base writable atom                   |
| `derived(read)`             | Create a read-only derived atom               |
| `writableAtom(read, write)` | Create a derived atom with custom write logic |
| `atomFamily(factory)`       | Memoized atom factory for parameterized atoms |
| `createAtomScope()`         | Create an isolated atom scope for SSR/testing |

## Types

`Atom<T>`, `ReadonlyAtom<T>`, `WritableAtom<V, A, R>`, `AnyReadableAtom<T>`, `AtomGetter`, `AtomSetter`, `AtomScope`

## Size

~0.8 KB gzipped (+ core)

## Documentation

- [API Reference](../../docs/api/atom/README.md)
- [Atom Design (LLD)](../../docs/architecture/atom-design.md)
npm package: @stateloom/core
Description: The reactive kernel for StateLoom. Provides the primitive building blocks that every other `@stateloom/*` package builds on.
Latest version: 1.0.0-alpha.0

# @stateloom/core

The reactive kernel for StateLoom. Provides the primitive building blocks that every other `@stateloom/*` package builds on.

## Install

```bash
pnpm add @stateloom/core
```

## Quick Start

```typescript
import { signal, computed, effect, batch } from '@stateloom/core';

const count = signal(0);
const doubled = computed(() => count.get() * 2);

const dispose = effect(() => {
  console.log(`count=${count.get()}, doubled=${doubled.get()}`);
  return undefined;
});
// "count=0, doubled=0"

batch(() => {
  count.set(5);
  count.update((n) => n + 1);
});
// "count=6, doubled=12" — fires once

dispose();
```

## Exports

| Export                  | Description                                    |
| ----------------------- | ---------------------------------------------- |
| `signal(value)`         | Mutable reactive value container               |
| `computed(fn)`          | Lazy, memoized derived value                   |
| `effect(fn)`            | Auto-tracking side effect with cleanup         |
| `batch(fn)`             | Coalesce multiple writes into one notification |
| `createScope()`         | SSR isolation scope                            |
| `runInScope(scope, fn)` | Execute code within a scope                    |
| `serializeScope(scope)` | Serialize scope state for hydration            |

## Types

`Subscribable<T>`, `Signal<T>`, `ReadonlySignal<T>`, `SignalOptions<T>`, `Scope`

## Size

~1.5 KB gzipped

## Documentation

- [API Reference](../../docs/api/core/README.md)
- [Core Design (LLD)](../../docs/architecture/core-design.md)
npm package: @stateloom/devtools
Description: Redux DevTools Extension bridge, console logger, and custom inspector API for StateLoom stores.
Latest version: 1.0.0-alpha.0

# @stateloom/devtools

Redux DevTools Extension bridge, console logger, and custom inspector API for StateLoom stores.

## Install

```bash
pnpm add @stateloom/devtools
```

## Quick Start

```typescript
import { devtools, logger } from '@stateloom/devtools';
import { createStore } from '@stateloom/store';

const store = createStore(
  (set) => ({
    count: 0,
    inc: () => set((s) => ({ count: s.count + 1 })),
  }),
  {
    middleware: [devtools({ name: 'Counter' }), logger({ diff: true })],
  },
);
```

## Exports

| Export               | Description                                                  |
| -------------------- | ------------------------------------------------------------ |
| `devtools(options?)` | Redux DevTools Extension bridge middleware                   |
| `logger(options?)`   | Console logging middleware with timestamps and diffs         |
| `inspect(listener)`  | Register a custom inspector for all stores                   |
| `clearInspectors()`  | Remove all registered inspectors                             |
| `InspectEventType`   | Event type constants (`Init`, `Set`, `Subscribe`, `Destroy`) |

## Documentation

Full documentation with API reference, patterns, and usage examples:
**[docs/api/devtools](../../docs/api/devtools/README.md)**

## License

MIT
npm package: @stateloom/history
Description: Snapshot-based undo/redo middleware for StateLoom stores.
Latest version: 1.0.0-alpha.0

# @stateloom/history

Snapshot-based undo/redo middleware for StateLoom stores.

## Install

```bash
pnpm add @stateloom/history
```

## Quick Start

```typescript
import { history } from '@stateloom/history';
import { createStore } from '@stateloom/store';

const h = history<{ count: number }>({ maxDepth: 50 });

const store = createStore(
  (set) => ({
    count: 0,
    inc: () => set((s) => ({ count: s.count + 1 })),
  }),
  { middleware: [h] },
);

store.getState().inc(); // count -> 1
h.undo(); // count -> 0
h.redo(); // count -> 1
h.canUndo.get(); // true
```

## Exports

| Export              | Description                                                           |
| ------------------- | --------------------------------------------------------------------- |
| `history(options?)` | Create undo/redo middleware with reactive `canUndo`/`canRedo` signals |

## Documentation

Full documentation with API reference, patterns, and integration examples:
**[docs/api/history](../../docs/api/history/README.md)**

## License

MIT
npm package: @stateloom/immer
Description: Immer integration for mutable draft syntax in StateLoom store `set()` calls.
Latest version: 1.0.0-alpha.0

# @stateloom/immer

Immer integration for mutable draft syntax in StateLoom store `set()` calls.

## Install

```bash
pnpm add @stateloom/immer immer
```

## Quick Start

```typescript
import { immer } from '@stateloom/immer';
import { createStore } from '@stateloom/store';

const store = createStore(
  immer((set) => ({
    todos: [] as Array<{ id: number; text: string; done: boolean }>,
    addTodo: (text: string) =>
      set((draft) => {
        draft.todos.push({ id: Date.now(), text, done: false });
      }),
    toggleTodo: (id: number) =>
      set((draft) => {
        const todo = draft.todos.find((t) => t.id === id);
        if (todo) todo.done = !todo.done;
      }),
  })),
);
```

## Exports

| Export                        | Description                                                  |
| ----------------------------- | ------------------------------------------------------------ |
| `immer(creator)`              | Wrap a state creator to enable Immer draft syntax in `set()` |
| `produceState(store, recipe)` | Apply an Immer recipe to any existing store                  |

## Documentation

Full documentation with API reference, patterns, and nested update examples:
**[docs/api/immer](../../docs/api/immer/README.md)**

## License

MIT
npm package: @stateloom/persist
Description: Declarative state persistence with pluggable storage backends and async hydration.
Latest version: 1.0.0-alpha.0

# @stateloom/persist

Declarative state persistence with pluggable storage backends and async hydration.

## Install

```bash
pnpm add @stateloom/persist
```

## Quick Start

```typescript
import { persist, localStorageBackend } from '@stateloom/persist';
import { createStore } from '@stateloom/store';

const persistMw = persist<{ count: number }>({
  key: 'counter',
  storage: localStorageBackend(),
});

const store = createStore(
  (set) => ({
    count: 0,
    inc: () => set((s) => ({ count: s.count + 1 })),
  }),
  { middleware: [persistMw] },
);
```

## Exports

| Export                     | Description                         |
| -------------------------- | ----------------------------------- |
| `persist(options)`         | Persistence middleware factory      |
| `localStorageBackend()`    | `localStorage` storage adapter      |
| `sessionStorageBackend()`  | `sessionStorage` storage adapter    |
| `cookieStorage(options?)`  | Cookie-based storage adapter        |
| `indexedDBStorage(dbName)` | IndexedDB async storage adapter     |
| `memoryStorage()`          | In-memory storage adapter (testing) |
| `PERSIST_ERROR_CODE`       | Error code constants                |

## Documentation

Full documentation with API reference, migration patterns, and storage adapter guide:
**[docs/api/persist](../../docs/api/persist/README.md)**

## License

MIT
npm package: @stateloom/persist-redis
Description: Redis-backed storage adapter for `@stateloom/persist`. Bring your own Redis client -- works with `ioredis`, `redis` (node-redis), and `@upstash/redis`.
Latest version: 1.0.0-alpha.0

# @stateloom/persist-redis

Redis-backed storage adapter for `@stateloom/persist`. Bring your own Redis client -- works with `ioredis`, `redis` (node-redis), and `@upstash/redis`.

## Install

```bash
pnpm add @stateloom/persist @stateloom/persist-redis
```

## Quick Start

```typescript
import Redis from 'ioredis';
import { persist } from '@stateloom/persist';
import { redisStorage } from '@stateloom/persist-redis';

const persistMw = persist<{ count: number }>({
  key: 'counter',
  storage: redisStorage({
    client: new Redis(),
    prefix: 'myapp:',
    ttl: 3600, // 1 hour
  }),
});
```

## Exports

| Export                 | Description                                        |
| ---------------------- | -------------------------------------------------- |
| `redisStorage(client)` | Create a `StorageAdapter` backed by a Redis client |

## Documentation

Full documentation with API reference, client patterns, and TTL examples:
**[docs/api/persist-redis](../../docs/api/persist-redis/README.md)**

## License

MIT
npm package: @stateloom/proxy
Description: Proxy-based mutable state with transparent tracking for StateLoom. Familiar to Valtio and MobX users.
Latest version: 1.0.0-alpha.0

# @stateloom/proxy

Proxy-based mutable state with transparent tracking for StateLoom. Familiar to Valtio and MobX users.

## Install

```bash
pnpm add @stateloom/core @stateloom/proxy
```

## Quick Start

```typescript
import { observable, snapshot, observe } from '@stateloom/proxy';

const state = observable({ count: 0, name: 'Alice' });

const dispose = observe(() => {
  console.log('Count:', state.count);
});
// "Count: 0"

state.count++; // "Count: 1"

const snap = snapshot(state); // deeply frozen with structural sharing

dispose();
```

## Exports

| Export                 | Description                                       |
| ---------------------- | ------------------------------------------------- |
| `observable(obj)`      | Create a deeply-proxied mutable state object      |
| `snapshot(proxy)`      | Create an immutable, structurally-shared snapshot |
| `observe(fn)`          | Auto-tracking side effect                         |
| `subscribe(proxy, cb)` | Subscribe to any mutation (including nested)      |
| `ref(value)`           | Opt a value out of proxying                       |

## Types

`Ref<T>`, `Snapshot<T>`

## Size

~1.2 KB gzipped (+ core)

## Documentation

- [API Reference](../../docs/api/proxy/README.md)
- [Proxy Design (LLD)](../../docs/architecture/proxy-design.md)