Fixed voidFunction
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
/* @flow */
|
/* @flow */
|
||||||
|
|
||||||
type genericFunction = (...args: Array<mixed>) => mixed;
|
|
||||||
type voidFunction = (...args: Array<mixed>) => void;
|
type voidFunction = (...args: Array<mixed>) => void;
|
||||||
|
|
||||||
const once = (fn: genericFunction): voidFunction => {
|
const once = (fn: voidFunction): voidFunction => {
|
||||||
let done = false;
|
let done = false;
|
||||||
return (...args) => {
|
return (...args) => {
|
||||||
if (!done) {
|
if (!done) {
|
||||||
|
|||||||
Reference in New Issue
Block a user