@blocknote/react
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
14 lines (13 loc) • 622 B
TypeScript
import type { Store } from "@blocknote/core";
/**
* Subscribe to a {@link Store}, optionally selecting a slice of its state.
*
* The component re-renders only when the selected value changes under a
* {@link shallow} comparison, so selectors are free to build a fresh object,
* `Map` or `Set` on each call.
*/
export declare function useStore<TState, TSelected = NoInfer<TState>>(store: Store<TState>, selector?: (state: TState) => TSelected): TSelected;
/**
* Compares two values one level deep, with special handling for `Map`, `Set` and `Date`.
*/
export declare function shallow<T>(objA: T, objB: T): boolean;