/nice-store

lite\flexible\extensible state management for react 一个轻量的、灵活的、易扩展的react状态管理方案

Primary LanguageTypeScriptMIT LicenseMIT

nice-store

npm version npm downloads

homepage

https://frontlich.github.io/nice-store/#/

usage

install

npm install nice-store

createCoreStore

import { createCoreStore } from "nice-store";

const store = createCoreStore(0);

store.subscribe(console.log);

store.setState(1); // will log 1
store.getState(); // 1

createStore

import { createStore } from "nice-store";

create enhanced store with initialState and enhancers

createStore(initialState, ...enhancers);

internal enhancers:

other enhancers: