@stembord/state-react
v0.2.12
Published
connect react components with state stores
Readme
ts-state-react
connect react components with state stores
Hooks
export const state = new State(INITIAL_STATE);
// Provider and Consumer from Context created with React.createContext
// useState is hook used to map state to props
export const { useState, Provider, Consumer, Context } = createHook(
state.getState()
);$ npm run todolist-hooksConnect
export const state = new State(INITIAL_STATE);
// Provider and Consumer from Context created with React.createContext
// connect is used to map state to props
export const { Context, Provider, Consumer, connect } = createContext(
state.getState()
);$ npm run todolist-connect