Closed gordonbrander closed 6 months ago
This PR factors out fx and logging into middleware. Store signature has changed, and includes a new parameter, middleware. Breaking change.
middleware
import {store, fxware} from 'spellcaster/spellcaster.js' const [state, send] = store({ state: {}, update, middleware: fxware(fx) })
This does a few things:
update(state: State, msg: Msg): State
next()
fxware
middleware(...ware)
Nice! LGTM, not that you need my approval ;)
This PR factors out fx and logging into middleware. Store signature has changed, and includes a new parameter,
middleware
. Breaking change.This does a few things:
update(state: State, msg: Msg): State
just returns a new statenext()
and transactions no longer have to exist as conceptsfxware
middleware is providedmiddleware(...ware)