Skip to content

Commit

Permalink
fix(rstream): emit first value immediately in fromInterval()
Browse files Browse the repository at this point in the history
- previously first value was only emitted after `delay` ms
  • Loading branch information
postspectacular committed Jul 16, 2018
1 parent 0508e40 commit 9be2018
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/rstream/src/from/interval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Stream } from "../stream";
export function fromInterval(delay: number, count = Number.POSITIVE_INFINITY) {
return new Stream<number>((stream) => {
let i = 0;
stream.next(i++);
let id = setInterval(() => {
stream.next(i++);
if (--count <= 0) {
Expand Down

0 comments on commit 9be2018

Please sign in to comment.