- Notifications
You must be signed in to change notification settings - Fork238
chore: cleanup code#189
Uh oh!
There was an error while loading.Please reload this page.
Conversation
vercelbot commentedJan 23, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The latest updates on your projects. Learn more aboutVercel for Git ↗︎
|
| /**@type{'idle' | 'renaming'}*/ | ||
| letstate='idle'; | ||
| letediting_state='idle'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
should we just make this a boolean?
| if (state.status==='set'||state.status==='switch') { | ||
| loading=true; | ||
| try { | ||
| clearTimeout(timeout); | ||
| awaitreset_adapter(state.stubs); | ||
| if (state.status==='switch') { | ||
| set_iframe_src(adapter.base+ path); | ||
| } | ||
| initial=false; | ||
| }catch (e) { | ||
| error=/**@type{Error}*/ (e); | ||
| console.error(e); | ||
| } | ||
| loading=false; | ||
| }elseif (state.status==='update'&&state.last_updated) { | ||
| constreload=awaitadapter.update([state.last_updated]); | ||
| if (reload) { | ||
| schedule_iframe_reload(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this stuff feels racy — i feel like this logic belongs elsewhere, though i don't have a great design to offer right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The race conditions should be handled internally inadapter.js, though I now realize I'm not making use of the"cancelled" outcome here
Uh oh!
There was an error while loading.Please reload this page.
closes#139
Output.svelteadapter.jsstate.jswith proper functions instead of writing to different writables all other the place