Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observables in and out #9

Open
mlajtos opened this issue Sep 8, 2018 · 0 comments
Open

Observables in and out #9

mlajtos opened this issue Sep 8, 2018 · 0 comments

Comments

@mlajtos
Copy link
Owner

mlajtos commented Sep 8, 2018

Description

In Observable-based interpreter, every function takes a raw JS value and returns an Observable. This breaks composionality and it is a bad design choice.

This problem complicates/prevents implementation of following functions which were trivial in Promise-based interpreter:

Solution

Obviously, every function should receive and return an Observable.

Consequences

  • function can decide on how to combine the Observables (via operators)
  • simple functions can be easily lifted to an Observable ones
  • every value the interpreter sees is an Observable (object === Observable of object containing Observables? whoa, ble, haha, hmm :D)
  • there can be (syntax) operators and functions for Observable operators
  • proper Flow implementation (and others constructs)
  • implementation of functions will be verbose (unless they are not automaticaly lifted)
  • Mouse.x * 10 should work right away
  • one can lost very easily in a higher-order Observables
  • What will function application do?
    • combineLatest should get two second-order Observables (?)
    • therefore Interpreter should manipulate only second-order Observables (?)
  • ...
  • more to think about..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant