Closed okonet closed 7 years ago
yeah we don't support those kinds of (un(der)documented) special flow features. This one should be relatively easy to add but I'm not sure if it's a good idea, given that it might not hang around in Flow.
Ugly work around:
type PossibleStates = 'PAUSED' | 'ACTIVE' | 'DELETED';
const MyStates: {[state: PossibleStates]: PossibleStates} = {
PAUSED: 'PAUSED',
ACTIVE: 'ACTIVE',
DELETED: 'DELETED',
};
function isActive2(ad: {state: PossibleStates}): boolean {
return ad.state === MyStates.ACTIVE;
};
Hi sorry for the delay, this project is now deprecated in favour of flow-runtime which aims for full flow compatibility. flow-runtime has support for special flow forms such as $Keys
and $Shape
I'm looking at this test: https://github.com/facebook/flow/blob/f1273c67638b5403973a496e30b4a3fe8dfe19bc/tests/enumerror/enumerror.js
but trying it my codebase results in
Uncaught ReferenceError: $Keys is not defined
.