첫 커밋
This commit is contained in:
28
.vite/deps/chunk-2TJP56W3.js
Normal file
28
.vite/deps/chunk-2TJP56W3.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// node_modules/.pnpm/zustand@5.0.7_@types+react@_351ff060662620a9a4f6757877b5b1df/node_modules/zustand/esm/vanilla.mjs
|
||||
var createStoreImpl = (createState) => {
|
||||
let state;
|
||||
const listeners = /* @__PURE__ */ new Set();
|
||||
const setState = (partial, replace) => {
|
||||
const nextState = typeof partial === "function" ? partial(state) : partial;
|
||||
if (!Object.is(nextState, state)) {
|
||||
const previousState = state;
|
||||
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
||||
listeners.forEach((listener) => listener(state, previousState));
|
||||
}
|
||||
};
|
||||
const getState = () => state;
|
||||
const getInitialState = () => initialState;
|
||||
const subscribe = (listener) => {
|
||||
listeners.add(listener);
|
||||
return () => listeners.delete(listener);
|
||||
};
|
||||
const api = { setState, getState, getInitialState, subscribe };
|
||||
const initialState = state = createState(setState, getState, api);
|
||||
return api;
|
||||
};
|
||||
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
||||
|
||||
export {
|
||||
createStore
|
||||
};
|
||||
//# sourceMappingURL=chunk-2TJP56W3.js.map
|
||||
Reference in New Issue
Block a user