### Hierarchy

- RegisteredHook

## Index

### Constructors

- constructor

### Properties

- _deregistered
- bind
- callback
- eventType
- invokeCount
- invokeLimit
- matchCriteria
- priority
- removeHookFromRegistry
- tranSvc

### Methods

- _getDefaultMatchCriteria
- _getMatchingNodes
- _matchingNodes
- deregister
- matches

## Constructors

- new RegisteredHook(tranSvc: TransitionService, eventType: TransitionEventType, callback: HookFn, matchCriteria: HookMatchCriteria, removeHookFromRegistry: function, options?: HookRegOptions): RegisteredHook

- #### Parameters

  - ##### tranSvc TransitionService

  - ##### eventType TransitionEventType

  - ##### callback HookFn

  - ##### matchCriteria HookMatchCriteria

  - ##### removeHookFromRegistry function

    - - (hook: RegisteredHook): void

      - #### Parameters

        - ##### hook RegisteredHook

        #### Returns void

  - ##### options: Default value HookRegOptions = {} as any

  #### Returns RegisteredHook

  - Defined in transition/hookRegistry.ts:58

## Properties

_deregistered: boolean = false

- Defined in transition/hookRegistry.ts:58

bind: any

- Defined in transition/hookRegistry.ts:55

callback: HookFn

- Defined in transition/hookRegistry.ts:62

eventType: TransitionEventType

- Defined in transition/hookRegistry.ts:61

invokeCount: number = 0

- Defined in transition/hookRegistry.ts:56

invokeLimit: number

- Defined in transition/hookRegistry.ts:57

matchCriteria: HookMatchCriteria

- Defined in transition/hookRegistry.ts:63

priority: number

- Defined in transition/hookRegistry.ts:54

removeHookFromRegistry: function

#### Type declaration

- - (hook: RegisteredHook): void

  - #### Parameters

    - ##### hook RegisteredHook

    #### Returns void

- Defined in transition/hookRegistry.ts:64

tranSvc: TransitionService

- Defined in transition/hookRegistry.ts:60

## Methods

- _getDefaultMatchCriteria(): HookMatchCriteria

- Gets the default match criteria (all `true`)

- Gets the default match criteria (all `true`)

  Returns an object which has all the criteria match paths as keys and `true` as values, i.e.:

  ```js { to: true, from: true, entering: true, exiting: true, retained: true, }

  #### Returns HookMatchCriteria

  - Defined in transition/hookRegistry.ts:106

- _getMatchingNodes(treeChanges: TreeChanges): IMatchingNodes

- Gets matching nodes as IMatchingNodes

- 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),
      };

  #### Parameters

  - ##### treeChanges TreeChanges

  #### Returns IMatchingNodes

  - Defined in transition/hookRegistry.ts:125

- _matchingNodes(nodes: PathNode[], criterion: HookMatchCriterion): PathNode[]

- Gets the matching PathNodes

- Gets the matching PathNodes

  Given an array of PathNodes, and a HookMatchCriterion, returns an array containing the PathNodes 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.

  #### Parameters

  - ##### nodes PathNode[]

  - ##### criterion HookMatchCriterion

  #### Returns PathNode[]

  - Defined in transition/hookRegistry.ts:86

- deregister(): void

- #### Returns void

  - Defined in transition/hookRegistry.ts:155

- matches(treeChanges: TreeChanges): IMatchingNodes

- Determines if this hook's matchCriteria match the given TreeChanges

- Determines if this hook's matchCriteria match the given TreeChanges

  #### Parameters

  - ##### treeChanges TreeChanges

  #### Returns IMatchingNodes

  :

  an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values are the matching PathNodes for each HookMatchCriterion (to, from, exiting, retained, entering)

  - Defined in transition/hookRegistry.ts:147

Generated using TypeDoc