Effector

JavaScriptの状態管理ライブラリ。
React, Vueにも対応している。

https://effector.now.sh/en

インストール

yarn add effector

# TypeScriptで使う場合
yarn add -D typescript
# Reactで使う場合
yarn add effector-react
# Vueで使う場合
yarn add effector-vue

Storeを作る

const store = createStore<number>(0)

複数のストアをまとめる

オブジェクトを引数にする場合

const name = createStore<string>('Bob')
const age = createStore<number>(10)


const rootFromObj = createStoreObject({name, age})
const rootFromArray = createStoreObject([name, age])

rootFromObj.watch(data => )

Ref:
https://effector.now.sh/en/api/effector/createStoreObject