# Class RegisteredHook

The registration data for a registered transition hook

- Defined in src/router/transition/hook-registry.js:39

##### Index

### Constructors

constructor

### Properties

_deregistered
bind
callback
eventType
invokeCount
invokeLimit
matchCriteria
priority
removeHookFromRegistry
tranSvc

### Methods

_getDefaultMatchCriteria
_getMatchingNodes
_matchingNodes
deregister
matches

## Constructors

### constructor

- new RegisteredHook(
  tranSvc: any,
  eventType: any,
  callback: any,
  matchCriteria: any,
  removeHookFromRegistry: any,
  options?: {},
  ): RegisteredHook

  #### Parameters

  - tranSvc: any
  - eventType: any
  - callback: any
  - matchCriteria: any
  - removeHookFromRegistry: any
  - options: {} = {}

  #### Returns RegisteredHook

  - Defined in src/router/transition/hook-registry.js:40

## Properties

### _deregistered

_deregistered: boolean

- Defined in src/router/transition/hook-registry.js:54
- Defined in src/router/transition/hook-registry.js:147

### bind

bind: any

- Defined in src/router/transition/hook-registry.js:56

### callback

callback: any

- Defined in src/router/transition/hook-registry.js:50

### eventType

eventType: any

- Defined in src/router/transition/hook-registry.js:49

### invokeCount

invokeCount: number

- Defined in src/router/transition/hook-registry.js:53

### invokeLimit

invokeLimit: any

- Defined in src/router/transition/hook-registry.js:57

### matchCriteria

matchCriteria: any

- Defined in src/router/transition/hook-registry.js:51

### priority

priority: any

- Defined in src/router/transition/hook-registry.js:55

### removeHookFromRegistry

removeHookFromRegistry: any

- Defined in src/router/transition/hook-registry.js:52

### tranSvc

tranSvc: any

- Defined in src/router/transition/hook-registry.js:48

## Methods

### _getDefaultMatchCriteria

- _getDefaultMatchCriteria(): any

  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.:

      {
        to: true,
        from: true,
        entering: true,
        exiting: true,
        retained: true,

  #### Returns any

  - Defined in src/router/transition/hook-registry.js:95

### _getMatchingNodes

- _getMatchingNodes(treeChanges: any, transition: any): any

  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: any
  - transition: any

  #### Returns any

  - Defined in src/router/transition/hook-registry.js:113

### _matchingNodes

- _matchingNodes(nodes: any, criterion: any, transition: any): any

  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.

  #### Parameters

  - nodes: any
  - criterion: any
  - transition: any

  #### Returns any

  - Defined in src/router/transition/hook-registry.js:74

### deregister

- deregister(): void

  #### Returns void

  - Defined in src/router/transition/hook-registry.js:145

### matches

- matches(treeChanges: any, transition: any): any

  Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]]

  #### Parameters

  - treeChanges: any
  - transition: any

  #### Returns any

  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)

  - Defined in src/router/transition/hook-registry.js:139