State
/ API ReferenceState
/ API ReferenceuseOptimisticStoreWithMiddleware
useOptimisticStoreWithMiddleware is very similar to useOptimisticStore. It is a so-called factory that adds middleware to the default useOptimisticStore.
Arguments
| Argument | Type | Description |
|---|---|---|
| middleware | Array? | 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()])
© 2024-present Robin Weser. All Rights Reserved.