Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 361 Bytes

index.md

File metadata and controls

17 lines (13 loc) · 361 Bytes

Home

Derived Store

Aggregates data from one or multiple stores into a single, read-only store.

import { createStore, createDerivedStore } from '@yobta/stores'

const store1 = createStore(1)
const store2 = createStore(1)
const derived = createDerivedStore(
  (state1, state2) => state1 + state2,
  store1,
  store2,
)