UNPKG

@datalayer/core

Version:

[![Datalayer](https://assets.datalayer.tech/datalayer-25.svg)](https://datalayer.io)

18 lines (17 loc) 595 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;