Module: @lexical/react/useLexicalSubscription
Type Aliases
LexicalSubscription
Ƭ LexicalSubscription<T
>: Object
Type parameters
Name |
---|
T |
Type declaration
Name | Type |
---|---|
initialValueFn | () => T |
subscribe | (callback : (value : T ) => void ) => () => void |
Defined in
packages/lexical-react/src/useLexicalSubscription.tsx:15
Functions
useLexicalSubscription
▸ useLexicalSubscription<T
>(subscription
): T
Shortcut to Lexical subscriptions when values are used for render.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
subscription | (editor : LexicalEditor ) => LexicalSubscription <T > | The function to create the LexicalSubscription. This function's identity must be stable (e.g. defined at module scope or with useCallback). |
Returns
T