I'm trying to use the the dispatch initializer as it is in the example with a log effect
const middleware = (dispatch) =>
(action, payload) => {
// Dispatch anonymous action which triggers logging effect.
dispatch((state) => [state, log(state)])
// Afterwards, carry on normally.
dispatch(action, payload)
}
app({
// ...
dispatch: middleware
})
but it ends in an endless loop. no matter what my log effect does. even if I just do dispatch(state => state) it gets in the loop.