State
/ API Reference
State
/ API Reference

useOptimisticStoreWithMiddleware

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

Arguments

ArgumentTypeDescription
middlewareArray?A list of middleware that is added to the default useOptimisticStore

Returns

(useOptimisticStore) instance of useOptimisticStore with added middleware

Example

import { useOptimisticStoreWithMiddleware, logger } from '@weser/state'

const useOptimisticStore = useOptimisticStoreWithMiddleware([logger()])
On this page