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

Tracking strategies for Reflux.all #29

Closed
spoike opened this issue Aug 1, 2014 · 5 comments
Closed

Tracking strategies for Reflux.all #29

spoike opened this issue Aug 1, 2014 · 5 comments

Comments

@spoike
Copy link
Member

spoike commented Aug 1, 2014

As detailed in #28 by @bripkens. The following strategies exist:

  • trackLastCall (currently implemented in Join parallel listeners to one #28 for Reflux.all) - takes the last argument received for each
  • trackFirstCall - takes the first argument received for each
  • trackAllCalls - mashes all arguments together
  • ensureEqualNumberOfCalls - throws error if something was called more than once before the promise was completed
@spoike spoike changed the title Tracking strategies for Reflux.All Tracking strategies for Reflux.all Aug 1, 2014
@spoike
Copy link
Member Author

spoike commented Aug 1, 2014

If it's only these strategies available then we probably should expose them as seperate functions on Reflux.

  • Reflux.all - trackLastCall
  • Reflux.allLeading - trackFirstCall
  • Reflux.allCalls - trackAllCalls
  • Reflux.allStrict - ensureEqualNumberOfCalls

@spoike
Copy link
Member Author

spoike commented Aug 1, 2014

Probably call rename them to joinXyz instead of allXyz... If it makes more sense for someone reading the code?

  • Reflux.all and Reflux.joinTrailing (alias) -> trackLastCall
  • Reflux.joinLeading(...) -> trackFirstCall
  • Reflux.joinRepeated(...) -> trackAllCalls
  • Reflux.joinStrictly(...) -> ensureEqualNumberOfCalls

Thoughts?

@bripkens
Copy link
Contributor

bripkens commented Aug 1, 2014

Separate functions sounds good. Especially since the function's interface (Reflux.all with multiple strategies) would otherwise become too complicated.

@spoike
Copy link
Member Author

spoike commented Sep 3, 2014

Here is a visual representation from baconJS of different join patterns. The most interesting ones are merge and combine.

@spoike
Copy link
Member Author

spoike commented Oct 28, 2014

This has been implemented in #92 so I'll close this.

@spoike spoike closed this as completed Oct 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants