Closed robinweser closed 5 years ago
Could look something like:
const model = [] const actions = { setList: (_, items) => items } const effects = { fetch: (actions) => fetch(....).then(actions.setList) } const Store = createStore({ model, actions, effects }) const SomeList = () => { const { state, effects } = useAlveron(Store) return ( <div> {state.map(el => <div>{el}</div>)} <button onClick={effects.fetch} /> </div> ) }
Has been implemented and is part of 3.0.0
Could look something like: