Effect CommunityEC
Effect Community3y ago
21 replies
Jess

Understanding the Utility of Ref in a Single-Threaded JavaScript Environment

i'm trying to understand the utility of Ref in effect, given JS is a single threaded env. it looks like all the Ref modification functions are synchronous, so i'm thinking that Ref provides a convenient wrapper for values, and utility functions for accessing those wrapped values, but that's really it. that is, access functions don't need to guarantee atomicity because there is only one thread, and no possibility of context switching in a synchronous function. do i have this right?
Was this page helpful?