File size: 457 Bytes
5144199 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import { createStore } from "@tanstack/store";
import { useState } from "react";
//#region src/useCreateStore.ts
function useCreateStore(valueOrFn, actions) {
const [store] = useState(() => {
if (typeof valueOrFn === "function") return createStore(valueOrFn);
if (actions) return createStore(valueOrFn, actions);
return createStore(valueOrFn);
});
return store;
}
//#endregion
export { useCreateStore };
//# sourceMappingURL=useCreateStore.js.map |