(blockId: string)
| 20 | } |
| 21 | |
| 22 | getBlockHighlightAtom(blockId: string): jotai.Atom<BlockHighlightType | null> { |
| 23 | let atom = this.blockHighlightAtomCache.get(blockId); |
| 24 | if (!atom) { |
| 25 | atom = jotai.atom((get) => { |
| 26 | const highlight = get(this.blockHighlightAtom); |
| 27 | if (highlight?.blockId === blockId) { |
| 28 | return highlight; |
| 29 | } |
| 30 | return null; |
| 31 | }); |
| 32 | this.blockHighlightAtomCache.set(blockId, atom); |
| 33 | } |
| 34 | return atom; |
| 35 | } |
| 36 | |
| 37 | setBlockHighlight(highlight: BlockHighlightType | null) { |
| 38 | globalStore.set(this.blockHighlightAtom, highlight); |
no test coverage detected