[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Store](https://evolu.dev/docs/api-reference/common/Store) › createStore

```ts
function createStore<T>(initialState: T, eq?: Eq<T>): Store<T>;
```

Defined in: [packages/common/src/Store.ts:58](https://github.com/evoluhq/evolu/blob/ca15b4661c40fedb9f47434497086039cbdea38e/packages/common/src/Store.ts#L58)

Creates a store with the given initial state. The store encapsulates its
state, which can be read with `get` and updated with `set` or `update`. All
changes are broadcast to subscribers.

By default, state changes are detected using [eqSameValueZero](https://evolu.dev/docs/api-reference/common/Eq/functions/eqSameValueZero), which
considers `NaN` equal to itself and `0` equal to `-0`. You can provide a
custom equality function as the second argument.