You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// From https://www.xoid.dev/docs/performance-optimizationsconst$atom=create(()=>{console.log('I am lazily evaluated!')returnexpensiveComputation(25)})
// Is it okay this way?const$atom=create(async()=>{console.log('I am lazily evaluated!')returnawaitexpensiveComputation(25)})
The text was updated successfully, but these errors were encountered:
Hi @0xErick , thank you for bringing this up. This would be a nice feature, but there isn't such feature yet. I may implement it as a separate helper such as promiseAtom, asyncAtom in the next version.
PS: I will likely won't add it as a side-feature to the create function ever, because detecting if a function is async isn't reliable on some JS runtimes. It'll likely be a different function that looks and feels like create.
The text was updated successfully, but these errors were encountered: