Effect CommunityEC
Effect Community15mo ago
19 replies
qlonik

Separating Sync and Async Operations when using effect

Hey guys! I'm trying to get my bearings on the approach with effect. We have largely fp-ts codebase with some hand-rolled abstractions. One of the primary abstractions is a synchronous state update that can produce asynchronous operations. I maybe would say it is a hand-rolled combination of State and Writer monads to work with state updates and collection of async operations. The asynchronous operations could themselves produce more synchronous updates that are queued at the end.

I'm trying to get there using effects. Obviously I can use Queue and Effect to model queue of updates and asynchronous operations. But I would really like to keep state updates as synchronous operations, as I think it will be helpful within synchronous vuejs UI code. Is there some method to enforce the separation between sync and async operations?
Was this page helpful?