grammarly / focal

Program user interfaces the FRP way.
Apache License 2.0
723 stars 34 forks source link

Fix `instanceof Observable` check #28

Open blacktaxi opened 6 years ago

blacktaxi commented 6 years ago

The current instanceof Observable check that is used in the implementation of lifted component relies on the class instance check, which in turn requires that the instance be checked against the same constructor it was created with.

However it is possible that user-created Observables come from a different version or just a different instance of the rxjs package. In that case the instanceof Observable check will always fail.

It seems that the issue of several rxjs packages in a bundle should not be affecting Focal, or if it does there should be a quick way to diagnose the issue.

One solution that I see is the adoption of symbol-observable check like it's done in Redux, etc.

sukazavr commented 5 years ago

I think, rxjs >= 6.3.0 doesn't work with focal 0.6.438 because of that. Lift just can't recognize that some of the properties are an Observable instance.