Middleware

Zoov's middleware is just uses zustand middleware, so you can expect everything zustand have in zoov.

Here are some common cases

Persist

the zustand doc

import { persist } from 'zustand/middleware';

const module = defineModule(...)
    .middleware: (store) => persist(store, { name: 'count2' })
    .build()

Devtools

import { devtools } from 'zustand/middleware'

const module = defineModule(...)
    .middleware: (store) => devtools(store, { name: "ModuleA" })
    .build()

Last updated