MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / commitState

Function commitState

packages/core/src/router/integration.ts:223–240  ·  view source on GitHub ↗
(nextState: RouterState, restoreFocus: boolean)

Source from the content-addressed store, hash-verified

221 }
222
223 function commitState(nextState: RouterState, restoreFocus: boolean): void {
224 if (nextState === state) return;
225 state = nextState;
226
227 pruneUnusedFocusSnapshots(focusSnapshotsByVisitId, state);
228
229 if (restoreFocus) {
230 const currentEntry = state.entries[state.entries.length - 1];
231 if (currentEntry) {
232 const snapshot = focusSnapshotsByVisitId.get(currentEntry.visitId);
233 if (snapshot) {
234 opts.restoreFocusSnapshot(snapshot);
235 }
236 }
237 }
238
239 opts.requestRouteRender();
240 }
241
242 function coerceFirstRouteId(routes: readonly RouteDefinition<S>[]): string {
243 const first = routes[0];

Callers 3

navigateFunction · 0.85
replaceFunction · 0.85
backFunction · 0.85

Calls 3

restoreFocusSnapshotMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected