MCPcopy Index your code
hub / github.com/editablejs/editable / getStore

Function getStore

packages/editor/src/plugin/locale.ts:15–25  ·  view source on GitHub ↗
(editor: Editor)

Source from the content-addressed store, hash-verified

13const EDITOR_TO_LOCALE_STORE: WeakMap<Editor, UseBoundStore<StoreApi<LocaleState>>> = new WeakMap()
14
15const getStore = (editor: Editor) => {
16 let store = EDITOR_TO_LOCALE_STORE.get(editor)
17 if (!store) {
18 store = create<LocaleState>(() => ({
19 lang: 'en-US',
20 locales: {},
21 }))
22 EDITOR_TO_LOCALE_STORE.set(editor, store)
23 }
24 return store
25}
26
27export const Locale = {
28 getStore,

Callers 1

locale.tsFile · 0.70

Calls 2

getMethod · 0.80
createFunction · 0.50

Tested by

no test coverage detected