Mixed types checker function to allow calling function with specific type
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
0
I am basically trying to create "checker" function and based on the result of that function, call another function. This another function can only accept single type. The checker function should "filter" unwanted types. Here is an example: class A {} class B {} const checkB = (entity: A | B): boolean => { return (entity instanceof B) } const execute = (b: B) => { console.log('executed') } const start = (entity: A | B) => { if (checkB(entity)) { execute(entity) } } const a = new A() const b = new B() start(a) start(b) However Flowtype does not like this a...