How to dynamicly import actors /services? #1335
-
Hi 👋 How to dynamically import actors /services? Simple example: https://codesandbox.io/s/fervent-banach-pdg8q?file=/src/App.tsx It's not working and it looks to me like it is in collision with invoking Promises. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It's not a collision with anything. The reason why this doesn't work is simpler: Notice how this is a good thing - |
Beta Was this translation helpful? Give feedback.
It's not a collision with anything. The reason why this doesn't work is simpler:
assign
is always synchronous so you can't useasync
functions within it.Notice how this is a good thing -
import()
is an async operation and it can fail. To provide a stellar UX/fault-tolerant logic you must handle this with appropriate error handling etc.