UNPKG

mt-flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

15 lines (14 loc) 355 B
/** * Middleware that changes the store type * */ const fooImpl = (f, bar) => (set, get, _store) => { const store = _store; store.foo = bar; return f(set, get, _store); }; export const foo = fooImpl; // --- // 使用例子: // const useBearStore = create(foo(() => ({ bears: 0 }), 'hello')) // console.log(useBearStore.foo.toUpperCase())