MCPcopy Create free account
hub / github.com/bytebase/bytebase / applyAndPersist

Function applyAndPersist

frontend/src/react/stores/workspaceApprovalSetting.ts:64–73  ·  view source on GitHub ↗
(nextConfig: LocalApprovalConfig)

Source from the content-addressed store, hash-verified

62
63 // Optimistically apply `nextConfig`, persist it, and roll back on failure.
64 const applyAndPersist = async (nextConfig: LocalApprovalConfig) => {
65 const backup = get().config;
66 set({ config: nextConfig });
67 try {
68 await persist(nextConfig);
69 } catch (err) {
70 set({ config: backup });
71 throw err;
72 }
73 };
74
75 return {
76 config: { rules: [] },

Callers 1

Calls 3

getFunction · 0.85
setFunction · 0.85
persistFunction · 0.85

Tested by

no test coverage detected