Effect CommunityEC
Effect Community3y ago
17 replies
Patrick Roza

PubSub Filtering Null Value Publishes

why would pubsub filter publishes with null value, even though it returns true
Effect.gen(function* ($) {
  const changeFeed = yield* $(PubSub.unbounded<null | string>())
  const q = yield* $(PubSub.subscribe(changefeed))
  yield* $(Queue.take(q).pipe(Effect.tap(v => Effect.logInfo("hello " + v)), Effect.forever, Effect.fork))
  yield* $(PubSub.publish(null)) // replace null with "there", and it works
  yield* $(Effect.sleep("1 hours"))
})
Was this page helpful?