Skip to content

push*(repeater) type API #57

@jedwards1211

Description

@jedwards1211

One of the kind of cool things about zen-observable is you can

new Observable(observer => {
  checkSomethingSynchronously()
  return someOtherObservable.subscribe(observer)
})

I'm looking for an elegant way to do this with repeater. Seems like right now I'd have to use for..await:

new Repeater(async (push, stop) => {
  await checkSomethingAsynchronously()
  for await (const x of someOtherRepeater) push(x)
})

The syntax isn't bad really, but didn't we come to the conclusion awhile back that using for..await like this is dangerous? I can never remember the caveats exactly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions