Skip to content

Commit

Permalink
fixing flow issue (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreardon authored Mar 27, 2019
1 parent 7f638ee commit bd4e07e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ export default function<ResultFn: (...any[]) => mixed>(
let calledOnce: boolean = false;

// breaking cache when context (this) or arguments change
// $ExpectError - faking the type of ResultFn
const result: ResultFn = function(...newArgs: mixed[]) {
const result = function(...newArgs: mixed[]) {
if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
return lastResult;
}
Expand All @@ -46,5 +45,5 @@ export default function<ResultFn: (...any[]) => mixed>(
return lastResult;
};

return result;
return (result: any);
}

0 comments on commit bd4e07e

Please sign in to comment.