MCPcopy
hub / github.com/puckeditor/puck / executeSequence

Function executeSequence

packages/core/reducer/actions/__helpers__/index.tsx:160–176  ·  view source on GitHub ↗
(
    initialState: PrivateAppState<UserData>,
    actions: ((currentState: PrivateAppState<UserData>) => PuckAction)[]
  )

Source from the content-addressed store, hash-verified

158 beforeEach(beforeEachFn);
159
160 const executeSequence = (
161 initialState: PrivateAppState<UserData>,
162 actions: ((currentState: PrivateAppState<UserData>) => PuckAction)[]
163 ) => {
164 let currentState: PrivateAppState<UserData> = initialState;
165
166 actions.forEach((actionFn) => {
167 const action = actionFn(currentState);
168
169 currentState = _reducer(
170 currentState,
171 action
172 ) as PrivateAppState<UserData>;
173 });
174
175 return currentState;
176 };
177
178 const reducer = (state: PrivateAppState, action: PuckAction) =>
179 _reducer(state, action);

Callers 6

remove.spec.tsFile · 0.85
duplicate.spec.tsFile · 0.85
replace.spec.tsFile · 0.85
move.spec.tsFile · 0.85
insert.spec.tsFile · 0.85
reorder.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected