File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export const arrayFilter = <Value>(
5656 cb : ( value : Value ) => boolean ,
5757) : Value [ ] => array . filter ( cb ) ;
5858
59- export const arrayClear = < Value > ( array : Value [ ] , to ?: number ) : Value [ ] =>
59+ export const arrayClear = < Value > ( array : Value [ ] = [ ] , to ?: number ) : Value [ ] =>
6060 array . splice ( 0 , to ) ;
6161
6262export const arrayPush = < Value > ( array : Value [ ] , ...values : Value [ ] ) : number =>
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import type {
1313 PersisterStats ,
1414 Persists as PersistsType ,
1515} from '../@types/persisters/index.d.ts' ;
16- import { arrayPush , arrayShift } from '../common/array.ts' ;
16+ import { arrayClear , arrayPush , arrayShift } from '../common/array.ts' ;
1717import {
1818 errorNew ,
1919 ifNotUndefined ,
@@ -257,7 +257,10 @@ export const createCustomPersister = <
257257
258258 const getStore = ( ) : Store => store ;
259259
260- const destroy = ( ) : Persister < Persist > => stopAutoLoad ( ) . stopAutoSave ( ) ;
260+ const destroy = ( ) : Persister < Persist > => {
261+ arrayClear ( mapGet ( scheduleActions , scheduleId ) ) ;
262+ return stopAutoLoad ( ) . stopAutoSave ( ) ;
263+ } ;
261264
262265 const getStats = ( ) : PersisterStats => ( { loads, saves} ) ;
263266
You can’t perform that action at this time.
0 commit comments