Skip to content

ui-router-signals / watchSelection

Function: watchSelection() ​

ts
function watchSelection<T>(
   expression, 
   equals, 
   apply
): () => void;

Defined in: ui-router-signals/src/watch.ts:10

Watches expression through a Signal.Computed and hands every new value to apply: once synchronously, then in a microtask after any source changes. A value the computed's equals judges unchanged is skipped.

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
expression() => T
equals((a, b) => boolean) | undefined
apply(value) => void

Returns ​

a function that stops watching.

() => void