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 @@ -49,16 +49,16 @@ export const createAsyncStoragePersistor = ({
4949 }
5050}
5151
52- function asyncThrottle < T > (
53- func : ( ...args : ReadonlyArray < unknown > ) => Promise < T > ,
52+ function asyncThrottle < Args extends readonly unknown [ ] , Result > (
53+ func : ( ...args : Args ) => Promise < Result > ,
5454 { interval = 1000 , limit = 1 } : { interval ?: number ; limit ?: number } = { }
5555) {
5656 if ( typeof func !== 'function' ) throw new Error ( 'argument is not function.' )
5757 const running = { current : false }
5858 let lastTime = 0
5959 let timeout : number
60- const queue : Array < any [ ] > = [ ]
61- return ( ...args : any ) =>
60+ const queue : Array < Args > = [ ]
61+ return ( ...args : Args ) =>
6262 ( async ( ) => {
6363 if ( running . current ) {
6464 lastTime = Date . now ( )
You can’t perform that action at this time.
0 commit comments