Handling asynchronous effects in reactive contexts like the one you're describing can indeed lead...

When I have an Rx that uses an async Effect

const derivedRx = Rx.make((get) => 
  Effect.gen(function* () {
    yield* Effect.sleep("10ms") 
    return yield* get.result(sourceRx)
  })
)

If sourceRx changes and I read derivedRx while it's recomputing, I get back the old value with a waiting flag. But get.result() doesn't seem to care about the waiting flag and returns a stale value immediately without blocking.

I assume this is intended behaviour, but are there any semantics to get strictly correct fresh values same way you would from a sync function? Everything I can think of is kind of hacky, like polling get() until it doesn't return .waiting and doing this at every single call site
Was this page helpful?