Skip to content

Releases: empty916/natur

v2.1.10 release

05 Mar 13:01
6a0c5e0

Choose a tag to compare

inject ref bug fix

  1. ref typescript improve
  2. prop ref of injected component extends wrap componet, if wrap component dose not support ref(like functional component without React.forwardRef), the injected component dose not support ref as well, if wrap component support ref, injected component support too.

v2.1.9 release

27 Aug 12:59

Choose a tag to compare

improve the inject typescript experience

  • v2.1.8 add watch api to avoid inject ts bug and it is recommended to use watch API, now inject API is more recommenced than watch API
  • the inject api has a good typescript experience in the scenario of injecting 10 modules. When part of the monitoring function is used for the injected part of more than 10 modules, the watch API will be more recommended.

v2.1.9-beta1 release

23 Aug 13:28

Choose a tag to compare

v2.1.9-beta1 release Pre-release
Pre-release

improve the inject typescript experience

  • v2.1.8 add watch api to avoid inject ts bug and it is recommended to use watch API
  • now inject API is more recommenced than watch API
  • the inject api has a good typescript experience in the scenario of injecting 10 modules. When part of the monitoring function is used for the injected part of more than 10 modules, the watch API will be more recommended.

v2.1.7 release

22 Aug 10:40
0023255

Choose a tag to compare

typescript improve

  • type error: due to typescript restrictions, some monitoring functions have added watch api. for more details, please see the documentation
// before. this way will not be removed
const injector = inect('module1', ['module2', {state: ['propertyOfModule2']}]);

// now. this is reccommend way, it has better typescript enjoyment
const injector = inect('module1', 'module2')
  .watch('module2', {state: ['propertyOfModule2']}); // It can be chained

v2.1.7 beta release

13 Aug 14:00

Choose a tag to compare

v2.1.7 beta release Pre-release
Pre-release

typescript improve

  • type error: due to typescript restrictions, some monitoring functions have added watch api.
// before. this way will not be removed
const injector = inect('module1', ['module2', {state: ['propertyOfModule2']}]);

// now. this is reccommend way, it has better typescript enjoyment
const injector = inect('module1', 'module2')
  .watch('module2', {state: ['propertyOfModule2']}); // It can be chained

v2.1.6 release

07 Jul 13:21
67e483d

Choose a tag to compare

-Adjust the timing of inject subscription, change to pre-render subscription (previously subscribed in the component constructor), and cancel the subscription after the component is destroyed
-Migrate the test solution enzyme to @testing-library/react

v2.1.5

30 May 13:44

Choose a tag to compare

bug fix

  • in subscribe, actionName type include "globalSetStates" | "globalResetStates"

other

  • change js unit test to ts unit test
  • remove example code
  • remove useless dependencies
  • dispatch invalid module won't throw error

2.1.5-beta版本发布

25 May 13:48

Choose a tag to compare

Pre-release

bug fix

  • in subscribe, actionName type include "globalSetStates" | "globalResetStates"

other

  • change js unit test to ts unit test
  • remove example code
  • remove useless dependencies

2.1.1 release

10 Jan 09:09

Choose a tag to compare

  1. module type change to commonjs
  2. the performance of lazy loading modules in globalSetStates is consistent with synchronization modules, and will pass through middleware

2.1.0 release

16 Dec 12:45

Choose a tag to compare

break change

  • createStore params improve
// before
createStore(syncModues, lazyModules, initStates, middlewares)
// now The third parameter becomes an option
createStore(syncModues, lazyModules, {
  initStates,
  middlewares
})
  • destory api change to destroy
// before
store.destory();
// now
store.destroy();
  • interceptor

    • Now you can control the execution of the action and the processing of the input parameters of the action
    • For more details, you can check the interceptor chapter of the document
  • type names change

    ActionRecord change to MiddlewareActionRecord
    Next change to MiddlewareNext

  • getAllStates api

    • now you can get all states by store.getAllStates()

No error will be reported when dispatch modules or actions that do not exist