open-index/open-npm huggingface dataset:
npm package: @stateloom/store
Description: Store-based state management for StateLoom
Latest version: 1.0.0-alpha.0

# @stateloom/store

Store-based state management for StateLoom. Familiar to Zustand and Redux Toolkit users.

## Install

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

## Quick Start

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

const counter = createStore((set, get) => ({
  count: 0,
  increment: () => set((s) => ({ count: s.count + 1 })),
  decrement: () => set((s) => ({ count: s.count - 1 })),
  reset: () => set({ count: 0 }),
}));

counter.getState().count; // 0
counter.getState().increment();
counter.getState().count; // 1
```

## Exports

| Export                           | Description                                      |
| -------------------------------- | ------------------------------------------------ |
| `createStore(creator, options?)` | Create a store with co-located state and actions |

## Types

`StoreApi<T>`, `StateCreator<T>`, `SetStateFn<T>`, `GetStateFn<T>`, `Listener<T>`, `SetFn<T>`, `Middleware<T>`, `MiddlewareAPI<T>`, `StoreOptions<T>`

## Size

~0.5 KB gzipped (+ core)

## Documentation

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