Or something... I don't see why it's that hard to type.
-
-
There is a problem with `next`: it takes an argument, but not when you call it for the first time
1 reply 0 retweets 0 likes -
And you don't want unions because it doesn't capture the fact that it's wrong to pass nothing after the first?
1 reply 0 retweets 0 likes -
right, union would be incorrect
1 reply 0 retweets 0 likes -
But it's not quite `any` right? Even strongly typed languages sometimes use Option/Maybe types to deal with state changes.
1 reply 0 retweets 0 likes -
The only safe option with current generator API is to make it require type `T` all the time.
1 reply 0 retweets 0 likes -
Replying to @vkurchatkin @wycats and
then you can opt in to omit the first time using `any`. This is much safer than union
1 reply 0 retweets 0 likes -
i don't like that you cannot tell the order specific next-value types come in... e.g in redux saga , you can only assert types at some point
1 reply 0 retweets 0 likes -
I've opened an issue in Flow do that. But it seems to be a limitation of type checking in general
1 reply 0 retweets 0 likes -
i know... so that was my point before... homogenous or intersection types are a must then, which is sad
1 reply 0 retweets 0 likes
It would require typestate, which is rough to implement, but not at all unique to this problem or JS-designed APIs.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.