MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / recordEdit

Function recordEdit

packages/studio/src/hooks/usePersistentEditHistory.ts:158–172  ·  view source on GitHub ↗
(input: RecordEditInput)

Source from the content-addressed store, hash-verified

156 return {
157 snapshot: () => snapshotEditHistoryState(state),
158 async recordEdit(input: RecordEditInput) {
159 await mutate<void>(async (currentState) => {
160 const timestamp = now();
161 const entry = buildEditHistoryEntry({
162 ...input,
163 id: createEntryId(timestamp),
164 projectId,
165 now: timestamp,
166 });
167 return {
168 state: pushEditHistoryEntry(currentState, entry),
169 result: undefined,
170 };
171 });
172 },
173 async undo(callbacks: ApplyCallbacks): Promise<ApplyResult> {
174 return mutate<ApplyResult>(async (currentState) => {
175 const entry = currentState.undo[currentState.undo.length - 1];

Callers 2

useRazorSplitFunction · 0.85

Calls 3

buildEditHistoryEntryFunction · 0.90
pushEditHistoryEntryFunction · 0.90
createEntryIdFunction · 0.85

Tested by

no test coverage detected