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

Flip argument order of takeUntil module #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 12, 2018

  1. Flip argument order of takeUntil module

    The takeUntil module violates one of the first principles of functional
    programming. Its argument order was (src, end) which is a data first
    argument order.
    
    This commit flips the argument order to (end, src) allowing us to better
    use takeUntil in pipelines such as:
    
    ```js
    const query = stream('');
    
    // Start fetching the results but if they haven't
    // arrived when a new query is emitted
    // stop listening to the stream
    const results = query
     .chain(q =>
        fromPromise(getResults(q))
          .pipe(takeUntil(query))
      )
    ```
    
    This also fixes an issue with takeUntil where if the new endStream had a
    value the dependent stream wouldn't update.
    Einar Norðfjörð committed Jul 12, 2018
    Configuration menu
    Copy the full SHA
    96c915c View commit details
    Browse the repository at this point in the history