MCPcopy Create free account
hub / github.com/jhen0409/react-native-debugger / handleChange

Function handleChange

app/worker/reduxAPI.js:228–252  ·  view source on GitHub ↗
(state, liftedState, maxAge, instance)

Source from the content-addressed store, hash-verified

226}
227
228function handleChange(state, liftedState, maxAge, instance) {
229 if (checkForReducerErrors(liftedState, instance)) return
230
231 const { filters, predicate } = instance
232 if (lastAction === 'PERFORM_ACTION') {
233 const { nextActionId } = liftedState
234 const liftedAction = liftedState.actionsById[nextActionId - 1]
235 if (isFiltered(liftedAction.action, filters)) return
236 if (predicate && !predicate(state, liftedAction.action)) return
237 relay('ACTION', state, instance, liftedAction, nextActionId)
238 if (!isExcess && maxAge) isExcess = liftedState.stagedActionIds.length >= maxAge
239 } else {
240 if (lastAction === 'JUMP_TO_STATE') return
241 if (lastAction === 'PAUSE_RECORDING') {
242 paused = liftedState.isPaused
243 } else if (lastAction === 'LOCK_CHANGES') {
244 locked = liftedState.isLocked
245 }
246 if (paused || locked) {
247 if (lastAction) lastAction = undefined
248 else return
249 }
250 relay('STATE', filterStagedActions(liftedState, filters), instance)
251 }
252}
253
254export default function devToolsEnhancer(options = {}) {
255 const {

Callers 1

devToolsEnhancerFunction · 0.85

Calls 2

checkForReducerErrorsFunction · 0.85
relayFunction · 0.85

Tested by

no test coverage detected