Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork22
Compare
Added in abatch()
function which allows you to run multipleStore.update()
inside of it, and have all the updates be batched at the same time to your App. Updates inbatch()
must be synchronous (can't be an async function). This allows defining cross-store updates in a more performant way, when these changes are made outside of the React event structures (regular button clicks etc.- these are batched by React by default).
Async Actions now also accept an extra option when being consumed:
const getImagesAction = GetImages.use({ tag: "green" }, { cacheBreak: true });
cacheBreak
can be a boolean or a function which returns a boolean value (the function signature is the same as the regularcacheBreakHook
that you can set when creating Async Actions).
This allows you to more finely control the cache breaking per a component- the next time a component is mounted, it will check this value and decide if we need to run the action anew.
This can also go hand-in-hand with another option:holdPrevious: true
- which will hold the previously result of the Async Action (if its available) while the action runs again on the cache break.
Pullstate now also defines that it supports the peer dependency ofreact
for versions^17.0.0
as well- this prevents NPM errors in the newer version, which is more strict about peer dependencies.
Assets2
Uh oh!
There was an error while loading.Please reload this page.