interface urlObj { [ key ] : any ; method : string ; url : string ; } let oldUrlObj = { method : '' , url : '' , } ; export function repeatCheck ( method , url ) { const newUrlObj = { method , url , } ; const isRepeat = objEqual ( oldUrlObj , newUrlObj ) ; if ( ! isRepeat ) { oldUrlObj = { ... newUrlObj } ; } return isRepeat ; } function objEqual ( x , y ) { for ( let prop in x ) { if ( y . hasOwnProperty ( prop ) ) { if ( ! ( x [ prop ] === y [ prop ] ) ) { return false ; } } else { return false ; } } return true ; }