Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

chore: cleanup code#189

Merged
Rich-Harris merged 11 commits intomainfromcleanup
Jan 24, 2023
Merged

chore: cleanup code#189

Rich-Harris merged 11 commits intomainfromcleanup
Jan 24, 2023

Conversation

@dummdidumm
Copy link
Member

@dummdidummdummdidumm commentedJan 23, 2023
edited
Loading

closes#139

  • move adapter stuff into its own componentOutput.svelte
  • move icons into one folder
  • move filetree into route where it's used and integrate more obviously with state
  • make it more robust to rapid editing / resolve / switch actions through queue-like implementation inadapter.js
  • make state easier to reason about by moving it intostate.js with proper functions instead of writing to different writables all other the place

@vercel
Copy link

vercelbot commentedJan 23, 2023
edited
Loading

The latest updates on your projects. Learn more aboutVercel for Git ↗︎

NameStatusPreviewCommentsUpdated
learn-svelte-dev✅ Ready (Inspect)Visit Preview💬Add your feedbackJan 24, 2023 at 5:45PM (UTC)

/**@type{'idle' | 'renaming'}*/
letstate='idle';
letediting_state='idle';
Copy link
Member

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?

@Rich-HarrisRich-Harris mentioned this pull requestJan 23, 2023
Comment on lines 39 to 62
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();
}
}
Copy link
Member

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

Copy link
MemberAuthor

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

@Rich-HarrisRich-Harris merged commit46dda23 intomainJan 24, 2023
@Rich-HarrisRich-Harris deleted the cleanup branchJanuary 24, 2023 18:33
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@Rich-HarrisRich-HarrisRich-Harris approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

make the code better

3 participants

@dummdidumm@Rich-Harris

[8]ページ先頭

©2009-2025 Movatter.jp