Releases: byte-fe/react-model
Releases · byte-fe/react-model
v3.1.2
v3.1.1
v3.1.0
v3.0.4
- feat(fallback): add fallback logic and error hint for invalid model
- build(package): update immer to version 6.0.0
v3.0.3
- feat(middleware): console payload under dev mode
- fix(ssr): fix hot reload issue on ssr + dev mode
v3.0.0
- feat(model): support user to expand actions' context
- fix(actions): fix the error types and key
install:
npm i --save react-model
Breaking changes 💥: NextModelType => ModelType
old.ts
const model = {
state: { key: value },
actions: {
setState: (state, actions, payload) => {
return { key: payload }
}
}
}
export default model
Now
import { Model } from 'react-model'
const model = {
state: { key: value },
actions: {
setState: (payload, { state, actions }) => {
return { key: payload }
}
}
}
export default Model(model)
// or export default model
Advance: https://www.npmjs.com/package/react-model/v/3.0.0#expand-context
v2.7.2
fix(subscribe): add the missing name for anonymous function
v2.7.1
- feat(middleware): allow user to customize each model's middlewares
v2.7.0
- perf(useStore): create/clean hash only when component mount/unmount
- refactor(model): refactor actions
- feat(model): refactor model initialize method
- style(lint): add ts-lint
v2.6.0
- docs(readme): make readme friendly to newcomers
- docs(issue): add Chinese issue template
- feat(subscribe): add unsubscribe api,add actions return value from Model
- refactor(middleware): add Global to context
- refactor(actions): extract similar comsumerActions in index.tsx
- style(global): .map => .entries/.foreach
- refactor(global): separate the state and actions
- docs(issue): beautify the issue template