waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

feat: remove `filter.subscribe()` dependency on `IReceiver` #1979

Open danisharora099 opened 2 months ago

danisharora099 commented 2 months ago

Problem

IReceiver currently expects subscribe() to be a function on the class implementation that we previously used for Filter. We moved to createSubscription() method instead, which is more generic.

Proposed Solutions

Remove the dependency which should allow us to remove the subscribe() implementation from Filter, and can just exist in the Subscription class instead

Notes

weboko commented 2 months ago

note: it is possible to remove .subscribe but we have to keep .toSubscriptionIterator to support js-noise

https://github.com/waku-org/js-noise/blob/44d0eecbfbf13eb9c69fadd05fa4494cff31229c/src/pairing.ts#L229

danisharora099 commented 2 months ago

note: it is possible to remove .subscribe but we have to keep .toSubscriptionIterator to support js-noise

https://github.com/waku-org/js-noise/blob/44d0eecbfbf13eb9c69fadd05fa4494cff31229c/src/pairing.ts#L229

Perfect. toSubscriptionIterator can remain part of SDK, and we can remove the subscribe() dependency from Core