MCPcopy Create free account
hub / github.com/ngrx/platform / notify

Method notify

modules/store-devtools/src/extension.ts:92–166  ·  view source on GitHub ↗
(action: LiftedAction, state: LiftedState)

Source from the content-addressed store, hash-verified

90 }
91
92 notify(action: LiftedAction, state: LiftedState) {
93 if (!this.devtoolsExtension) {
94 return;
95 }
96 // Check to see if the action requires a full update of the liftedState.
97 // If it is a simple action generated by the user's app and the recording
98 // is not locked/paused, only send the action and the current state (fast).
99 //
100 // A full liftedState update (slow: serializes the entire liftedState) is
101 // only required when:
102 // a) redux-devtools-extension fires the @@Init action (ignored by
103 // @ngrx/store-devtools)
104 // b) an action is generated by an @ngrx module (e.g. @ngrx/effects/init
105 // or @ngrx/store/update-reducers)
106 // c) the state has been recomputed due to time-traveling
107 // d) any action that is not a PerformAction to err on the side of
108 // caution.
109 if (action.type === PERFORM_ACTION) {
110 if (state.isLocked || state.isPaused) {
111 return;
112 }
113
114 const currentState = unliftState(state);
115 if (
116 shouldFilterActions(this.config) &&
117 isActionFiltered(
118 currentState,
119 action,
120 this.config.predicate,
121 this.config.actionsSafelist,
122 this.config.actionsBlocklist
123 )
124 ) {
125 return;
126 }
127 const sanitizedState = this.config.stateSanitizer
128 ? sanitizeState(
129 this.config.stateSanitizer,
130 currentState,
131 state.currentStateIndex
132 )
133 : currentState;
134 const sanitizedAction = this.config.actionSanitizer
135 ? sanitizeAction(
136 this.config.actionSanitizer,
137 action,
138 state.nextActionId
139 )
140 : action;
141
142 this.sendToReduxDevtools(() =>
143 this.extensionConnection.send(sanitizedAction, sanitizedState)
144 );
145 } else {
146 // Requires full state update
147 const sanitizedLiftedState = {
148 ...state,
149 stagedActionIds: state.stagedActionIds,

Callers 2

constructorMethod · 0.80
extension.spec.tsFile · 0.80

Calls 10

sendToReduxDevtoolsMethod · 0.95
getExtensionConfigMethod · 0.95
unliftStateFunction · 0.90
shouldFilterActionsFunction · 0.90
isActionFilteredFunction · 0.90
sanitizeStateFunction · 0.90
sanitizeActionFunction · 0.90
sanitizeActionsFunction · 0.90
sanitizeStatesFunction · 0.90
sendMethod · 0.65

Tested by

no test coverage detected