UNPKG

@datalayer/core

Version:
18 lines (17 loc) 594 B
/* * Copyright (c) 2023-2025 Datalayer, Inc. * Distributed under the terms of the Modified BSD License. */ import { createStore } from 'zustand/vanilla'; import { useStore } from 'zustand'; export const jupyterLabStore = createStore((set, get) => ({ jupyterLabAdapter: undefined, setJupyterLabAdapter: (jupyterLabAdapter) => set((state) => ({ jupyterLabAdapter })), plugin: (id) => { return get().jupyterLabAdapter?.plugin(id); } })); export function useJupyterLabStore(selector) { return useStore(jupyterLabStore, selector); } export default useJupyterLabStore;