Function: getDependencyGraph

index.getDependencyGraph

getDependencyGraph(target): DependencyGraphNode

Inspects and retrieves the reactive dependency graph node for a target object.

Parameters

Name Type Description
target object The target object or store to inspect.

Returns

DependencyGraphNode

A DependencyGraphNode describing subscriber counts per property.

Example

import { makeReactive, effect, getDependencyGraph } from '@banksia/signals';

const state = makeReactive({ a: 1, b: 2 });
effect(() => console.log(state.a));

const graph = getDependencyGraph(state);
console.log(graph.properties['a'].subscriberCount); // 1
ON THIS PAGE