useStoreWithMiddleware

useStoreWithMiddleware is very similar to useStore.
It is a so-called factory that adds middleware to the default useStore.

Arguments

ArgumentTypeDescription
middlewareArray?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])
Crafted with ♡ by Robin Weser