Detecting sync vs async context

How would one detect whether an effect is running in a sync or async context? I'm trying to wrap an api that provides both sync and async calls and ideally I would like to be able to support both contexts. I could of course just wrap the sync calls and that would work in both cases but when running async it would be more efficient to use the async api. Or maybe it makes sense to just wrap the async api and not support Effect.runSync..
Was this page helpful?