CreateStoreOptionsType
Last updated
Was this helpful?
Last updated
Was this helpful?
log
Setting this flag will enable/disable the custom logger middleware. The logger highlights the previous state, the payload of the update and the content of the new state.
subscribe
persist
It uses the same PersistOptions
as zustand's persist middleware with only 2 differences:
getStorage
is now required instead of optional. This is due to the fact that zustand uses LocalStorage by default when this field is not provided, which wouldn't work with React Native.
The detailed API reference is available here:
customMiddlewares
There is a known bug if you're using Flipper as it doesn't allow syntax highlighting for logs ().
Setting this flag will enable/disable the new middleware and make it accessible via .
name
is now optional instead of required. This is because zfy simply uses the name
you provided as 1st argument by default. Of course, you can still override it here if need be.
This field allows you to provide middlewares to zfy. This could be one that you created yourself from scratch or a prebuilt zustand middleware that zfy doesn't already expose. Please refer to the guide if you want to know how to use this option.