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

Implement combineLatest for AsyncIterable #113

Closed
mattpodwysocki opened this issue Oct 27, 2017 · 1 comment
Closed

Implement combineLatest for AsyncIterable #113

mattpodwysocki opened this issue Oct 27, 2017 · 1 comment
Assignees

Comments

@mattpodwysocki
Copy link
Contributor

mattpodwysocki commented Oct 27, 2017

IxJS version:

Code to reproduce:

Expected behavior:

Actual behavior:

Additional information:

Add combineLatest which mirrors zip but will track the latest from each AsyncIterable input.

function delay(time) {
  return new Promise(res => setTimeout(res, time));
}

async function* delayEvery(value, time) {
  while (1) {
    await delay(time);
    yield value;
  }
}

const s1 = delayEvery(42, 500);
const s2 = delayEvery(56, 1250);

const s3 = combineLatest(s1, s2);
for await (const [fst, snd] of s3) {
  console.log(`{fst} - {snd}`);
}
@mattpodwysocki
Copy link
Contributor Author

Closed by #132

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