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

Inconsistent argument order in takeuntil #121

Open
zspecza opened this issue Jul 18, 2016 · 3 comments
Open

Inconsistent argument order in takeuntil #121

zspecza opened this issue Jul 18, 2016 · 3 comments

Comments

@zspecza
Copy link

zspecza commented Jul 18, 2016

Given this excerpt from the readme, I assume all flyd modules should accept the operation data as the last parameter:

More functional in style. Flyd is more functional than existing FRP libraries. Instead of methods it gives you curried functions with arguments in the order suitable for partial application. This gives more expressive power and modularity.

Why does takeuntil deviate from this paradigm? Is there a specific reason?

To me, takeuntil(endStream, source) makes more sense.

I can make a pass at a PR for this, just want to find out if it's not an important design decision that I'm missing the point of first.

@irisjae
Copy link

irisjae commented Feb 2, 2017

This bit me today. Should I make a PR?

@irisjae
Copy link

irisjae commented Feb 2, 2017

In fact, as a side note, I found many of the modules listed to be the causes of problems which disappeared once I replaced them with flyd.transduce and Ramda. Perhaps, either they should be much more scrutinized, or just drops those which have Ramda equivalents.

@nordfjord
Copy link
Collaborator

I agree, this is very surprising behaviour.

I think we need to either

  1. Flip the argument order
  2. Document why this is the argument order in the readme for takeuntil

Personally I always import takeuntil like this

import * as takeuntil from 'flyd/module/takeuntil';
const takeUntil = R.flip(takeuntil);

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

3 participants