cujojs / most

Ultra-high performance reactive programming
MIT License
3.49k stars 231 forks source link

Type definitions for observables #485

Open TrySound opened 7 years ago

TrySound commented 7 years ago

from in types accepts Observable which is not correct. It should be { [SymbolObservable]: Observable } according source code. Flow has some problems with symbols. Don't know about typescript.

briancavalier commented 7 years ago

Sadly, I don't think it's possible in Flow right now to use symbols. That basically means that Flow users aren't doing to be able to use Observables in general, so I don't think we're currently making the situation any worse. If we are, though, and there's a way we could do better, I'm all for it.

@TylorS @Frikki: do either of you know if it's possible in TS?

TylorS commented 7 years ago

In TypeScript the situation is similar. I've been following this thread for over a year now.

TypeScript is only capable of handling "well-known" (by TypeScript) Symbols in types. e.g. Symbol.iterator and other Symbol.**.

briancavalier commented 7 years ago

Thanks @TylorS. Seems like we've done all we can do for now until Flow and TS support Symbol.observable.

Kinrany commented 5 years ago

In TypeScript the situation is similar. I've been following this thread for over a year now.

https://github.com/Microsoft/TypeScript/issues/5579 has been fixed.