Releases: empty916/natur
Releases · empty916/natur
v2.1.10 release
inject ref bug fix
- ref typescript improve
- 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
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
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
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 chainedv2.1.7 beta 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 chainedv2.1.6 release
-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
2.1.5-beta版本发布
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
- module type change to commonjs
- the performance of lazy loading modules in globalSetStates is consistent with synchronization modules, and will pass through middleware
2.1.0 release
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
ActionRecordchange toMiddlewareActionRecord
Nextchange toMiddlewareNext -
getAllStates api
- now you can get all states by
store.getAllStates()
- now you can get all states by