js-waku
js-waku copied to clipboard
Provide an async function to wait for the next message on a filter subscription
This is a feature request
Problem
As a dev, I may prefer to do a await subscription.next()
on a filter subscription rather than passing a callback function.
Proposed Solutions
We did implement some IReceiver
with toSubscriptionIterator
, I wonder if this can help?
If so, it may just be a question of documenting its usage.
Here is an example of how toSubscriptionIterator
can be used to achieve await subscription.next()
API
The next step would be to document it in a way that developers are aware of such an opportunity.
@LordGhostX let's discuss how we can achieve it.
I propose to (also) expose an event-based API for Filter
I'll open an issue to track this separately: #1682
@LordGhostX are you able to pick this issue up?