Think about the current version vs koa middleware, we've implemented it as an array and it make confusing and chaos here, I think koa middleware is a classic model looks simple and easily to use.
It support enhance before and after state change, we should define a middleware interface and provider the most impotant middlewares, no need subscribe api here.
import Model, { middlewares } from 'react-model'
const model = Model(models)
model.use(middlewares.logger())
model.use(middlewares.devTool())
middlewares should works with different model:
const modelA = Model({})
const modelB = Model({})
modelA.use(middlewares.logger())
modelB.use(middlewares.devTool())
const { useStoreA } from modelA
const { useStoreB } from modelB
Think about the current version vs koa middleware, we've implemented it as an array and it make confusing and chaos here, I think koa middleware is a classic model looks simple and easily to use.
how does it look like
It support enhance before and after state change, we should define a middleware interface and provider the most impotant middlewares, no need
subscribe
api here.middlewares should works with different model: