Skip to main content
cngx-src documentation

createSignificantChangeTracker

Functioncommon/chartv0.1.0

projects/common/chart/chart/significant-change.ts

Description#

Derive the most recent significant transition from a chart-summary signal, or null when the latest update carried no significance.

Mirrors createTransitionTracker's current/previous discipline: an internal linkedSignal holds the current summary and the one before it (structural-equality guarded), and the public signal is a computed with its own structural equal - so a summary that re-emits an equivalent shape yields the same null reference and never re-fires a downstream effect. Threshold crossings take precedence over trend flips (they are operationally more significant).

The chart stays pure-derivation: effects that react to the event live in the companion announcer, not here.

Signature#

createSignificantChangeTracker(summary: Signal)

Parameters#

@paramsummarySignal

the chart's CngxChartSummary signal.

Returns#

Signal