chore(middleware): cleanup
This commit is contained in:
@@ -4,6 +4,12 @@ import type { EdgeChange } from '@xyflow/system';
|
||||
import { useStoreApi } from './useStore';
|
||||
import type { Edge, Node } from '../types';
|
||||
|
||||
/**
|
||||
* Registers a middleware function to transform edge changes.
|
||||
*
|
||||
* @public
|
||||
* @param fn - Middleware function. Should be memoized with useCallback to avoid re-registration.
|
||||
*/
|
||||
export function experimental_useOnEdgesChangeMiddleware<EdgeType extends Edge = Edge>(
|
||||
fn: (changes: EdgeChange<EdgeType>[]) => EdgeChange<EdgeType>[]
|
||||
) {
|
||||
|
||||
@@ -4,6 +4,12 @@ import type { NodeChange } from '@xyflow/system';
|
||||
import { useStoreApi } from './useStore';
|
||||
import type { Edge, Node } from '../types';
|
||||
|
||||
/**
|
||||
* Registers a middleware function to transform node changes.
|
||||
*
|
||||
* @public
|
||||
* @param fn - Middleware function. Should be memoized with useCallback to avoid re-registration.
|
||||
*/
|
||||
export function experimental_useOnNodesChangeMiddleware<NodeType extends Node = Node>(
|
||||
fn: (changes: NodeChange<NodeType>[]) => NodeChange<NodeType>[]
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user