Gets matching nodes as [[IMatchingNodes]]
Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to:
let matches: IMatchingNodes = {
to: _matchingNodes([tail(treeChanges.to)], mc.to),
from: _matchingNodes([tail(treeChanges.from)], mc.from),
exiting: _matchingNodes(treeChanges.exiting, mc.exiting),
retained: _matchingNodes(treeChanges.retained, mc.retained),
entering: _matchingNodes(treeChanges.entering, mc.entering),
};
Gets the matching [[PathNode]]s
Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing
the [[PathNode]]s that the criteria matches, or null
if there were no matching nodes.
Returning null
is significant to distinguish between the default
"match-all criterion value" of true
compared to a () => true
function,
when the nodes is an empty array.
This is useful to allow a transition match criteria of entering: true
to still match a transition, even when entering === []
. Contrast that
with entering: (state) => true
which only matches when a state is actually
being entered.
Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]]
an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering)
The registration data for a registered transition hook