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

Figuring out join combinators. #620

Closed
alexander-matsievsky opened this issue Jul 26, 2015 · 3 comments
Closed

Figuring out join combinators. #620

alexander-matsievsky opened this issue Jul 26, 2015 · 3 comments

Comments

@alexander-matsievsky
Copy link

Good day!

Please take a look at this. It is an implementation of a reference TodoMVC app.

The solution works as advertised. Nevertheless, I feel I'm missing something about joining streams.

update function

At first I though that would work:

if (error) {
  return new Bacon.Error(error);
} else {
  return new Bacon.Next([todos, todo]);
}

but had to settle for a solution with node-like running state:

if (error) {
  return [todos, error, null];
} else {
  return [todos, null, todo];
}

Is my reasoning flawed?

when joins

The update stream holds the the current todo-list :Todo[] and the last change with full info :Todo (whether creation, update or deletion). This code block extracts this change in a categorized way. My question is whether I'm doing it right or there is a better way to handle a situation like

POST triggered an update. Get the events from update initiated by POST and skip the ones triggered by PUT and DELETE.

@alexander-matsievsky
Copy link
Author

@raimohanska Could you help me out with the above issue?

@raimohanska
Copy link
Contributor

sorry I'm a bit busy. maybe someone else has time to review the code?

@alexander-matsievsky
Copy link
Author

@raimohanska Yes, of course. Thanx for an amazing library!+)

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

2 participants