Skip to content

Instantly share code, notes, and snippets.

@kievsash
Last active January 28, 2019 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kievsash/9890aeddb85b02a9973bd93659c8354f to your computer and use it in GitHub Desktop.
Save kievsash/9890aeddb85b02a9973bd93659c8354f to your computer and use it in GitHub Desktop.
groupBy Solution
const selector = (x) => x.userId
const throttleTimeout = 3000;
source$
.pipe(
groupBy(selector),
mergeMap((group$) => group$.pipe(throttleTime(throttleTimeout)))
)
.subscribe(showNotification);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment