(
getContent: () => PersistedContent<Persist>,
changes?: PersistedChanges<Persist, true>,
)
| 196 | }) as any; |
| 197 | |
| 198 | const setPersisted = ( |
| 199 | getContent: () => PersistedContent<Persist>, |
| 200 | changes?: PersistedChanges<Persist, true>, |
| 201 | ): Promise<void> => |
| 202 | transaction(async () => { |
| 203 | await refreshSchema(); |
| 204 | if (!isUndefined(changes)) { |
| 205 | await saveTables(changes[0] as any, true); |
| 206 | await saveValues(changes[1] as any, true); |
| 207 | } else { |
| 208 | const [tables, values] = getContent() as any; |
| 209 | await saveTables(tables); |
| 210 | await saveValues(values); |
| 211 | } |
| 212 | }); |
| 213 | |
| 214 | const destroy = async () => { |
| 215 | await persister.stopAutoPersisting(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…