(
changes?: PersistedChanges<
Persist,
IsSynchronizer extends 1 ? false : true
>,
)
| 273 | const isAutoLoading = () => !isUndefined(autoLoadHandle); |
| 274 | |
| 275 | const save = async ( |
| 276 | changes?: PersistedChanges< |
| 277 | Persist, |
| 278 | IsSynchronizer extends 1 ? false : true |
| 279 | >, |
| 280 | ): Promise<Persister<Persist>> => { |
| 281 | /*! istanbul ignore else */ |
| 282 | if (status != StatusValues.Loading) { |
| 283 | setStatus(StatusValues.Saving); |
| 284 | saves++; |
| 285 | await schedule(async () => { |
| 286 | await tryCatch( |
| 287 | () => setPersisted(getContent as any, changes), |
| 288 | onIgnoredError, |
| 289 | ); |
| 290 | setStatus(StatusValues.Idle); |
| 291 | }); |
| 292 | } |
| 293 | return persister; |
| 294 | }; |
| 295 | |
| 296 | const startAutoSave = async (): Promise<Persister<Persist>> => { |
| 297 | stopAutoSave(); |
no test coverage detected
searching dependent graphs…