gordonbrander / spellcaster

Reactive signals UI library
MIT License
57 stars 2 forks source link

Update middleware signature to ~ match Redux #64

Closed gordonbrander closed 4 days ago

gordonbrander commented 4 days ago

Middleware is now a function of: (state: State) => (send: (msg: Msg) => void) => (msg: Msg) => void;

This gives middleware the ability to sample state.

Fxware now samples state, and the fx generating function signature receives the state as the first argument.

Practically speaking, when I've used an fx manager in applications, I have occasionally wanted access to the program state when generating the effect. This gives middleware that opportunity.