File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/createAsyncStoragePersistor-experimental Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -51,16 +51,16 @@ export const createAsyncStoragePersistor = ({
5151 }
5252}
5353
54- function asyncThrottle < T > (
55- func : ( ...args : ReadonlyArray < unknown > ) => Promise < T > ,
54+ function asyncThrottle < Args extends readonly unknown [ ] , Result > (
55+ func : ( ...args : Args ) => Promise < Result > ,
5656 { interval = 1000 , limit = 1 } : { interval ?: number ; limit ?: number } = { }
5757) {
5858 if ( typeof func !== 'function' ) throw new Error ( 'argument is not function.' )
5959 const running = { current : false }
6060 let lastTime = 0
6161 let timeout : number
62- const queue : Array < any [ ] > = [ ]
63- return ( ...args : any ) =>
62+ const queue : Array < Args > = [ ]
63+ return ( ...args : Args ) =>
6464 ( async ( ) => {
6565 if ( running . current ) {
6666 lastTime = Date . now ( )
You can’t perform that action at this time.
0 commit comments