snapshot of https://github.com/excalidraw/excalidraw.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Tests / test (push) Failing after 15s
Some checks failed
Tests / test (push) Failing after 15s
This commit is contained in:
18
packages/excalidraw/editor-jotai.ts
Normal file
18
packages/excalidraw/editor-jotai.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import {
|
||||
atom,
|
||||
createStore,
|
||||
type PrimitiveAtom,
|
||||
type WritableAtom,
|
||||
} from "jotai";
|
||||
import { createIsolation } from "jotai-scope";
|
||||
|
||||
const jotai = createIsolation();
|
||||
|
||||
export { atom, PrimitiveAtom, WritableAtom };
|
||||
export const { useAtom, useSetAtom, useAtomValue, useStore } = jotai;
|
||||
export const EditorJotaiProvider: ReturnType<
|
||||
typeof createIsolation
|
||||
>["Provider"] = jotai.Provider;
|
||||
|
||||
export const editorJotaiStore: ReturnType<typeof createStore> = createStore();
|
||||
Reference in New Issue
Block a user