Server: Phase 2 (REVIEW not respected yet)
This commit is contained in:
1 parent
5d16ded553
commit
142b47674d
4271 files changed
+1203269
No files matched your search
+16
@@ -0,0 +1,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
|
||||
Reference in new issue
Block a user