Skip to content

Releases: byte-fe/react-model

v3.1.2

19 May 12:23
4c071c2
Compare
Choose a tag to compare
  • feat(middleware): support enable/disable sepecific middleware (#160)

v3.1.1

18 May 13:43
6810d38
Compare
Choose a tag to compare
  • fix(stateupdater): fix the issue that setState on unmounted component (#153)

v3.1.0

28 Mar 08:58
f745d03
Compare
Choose a tag to compare
  • feat(ssr): only return asyncState from server side (#146)

v3.0.4

10 Mar 10:10
a217007
Compare
Choose a tag to compare
  • feat(fallback): add fallback logic and error hint for invalid model
  • build(package): update immer to version 6.0.0

v3.0.3

23 Oct 09:58
Compare
Choose a tag to compare
  • feat(middleware): console payload under dev mode
  • fix(ssr): fix hot reload issue on ssr + dev mode

v3.0.0

25 Jun 07:37
67ffffc
Compare
Choose a tag to compare
  • 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

npm: https://www.npmjs.com/package/react-model/v/3.0.0

v2.7.2

16 May 08:18
17c609a
Compare
Choose a tag to compare

fix(subscribe): add the missing name for anonymous function

v2.7.1

26 Apr 10:46
103b146
Compare
Choose a tag to compare
  • feat(middleware): allow user to customize each model's middlewares

v2.7.0

12 Apr 08:32
1913871
Compare
Choose a tag to compare
  • 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

03 Apr 14:07
Compare
Choose a tag to compare
  • 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