useStoreWithMiddleware
useStoreWithMiddleware is very similar to useStore.
It is a so-called factory that adds middleware to the default useStore.
Arguments
Argument | Type | Description |
---|---|---|
middleware | Array? | A list of middleware that is added to the default useStore |
Returns
(useStore) instance of useStore with added middleware
Example
import { useStore } from 'alveron'import logger from 'alveron-middleware-logger'
const useStore = useStoreWithMiddleware([logger])