-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve editor and routing transition loading with suspense (#350)
* feat: improve editor page load with suspense * feat: suspense and state sync improvements
- Loading branch information
1 parent
0b9c911
commit dd93b28
Showing
21 changed files
with
505 additions
and
345 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
apps/codeimage/src/components/KeyboardShortcuts/KeyboardShortcuts.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
apps/codeimage/src/components/PropertyEditor/SuspenseEditorItemt.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {getEditorSyncAdapter} from '@codeimage/store/editor/createEditorInit'; | ||
import {JSX, ParentProps, Suspense} from 'solid-js'; | ||
|
||
export function SuspenseEditorItem( | ||
props: ParentProps<{fallback: JSX.Element}>, | ||
) { | ||
const {loadedSnippet} = getEditorSyncAdapter()!; | ||
|
||
const render = () => { | ||
loadedSnippet(); | ||
return true; | ||
}; | ||
|
||
return ( | ||
<Suspense fallback={props.fallback}>{render() && props.children}</Suspense> | ||
); | ||
} |
Oops, something went wrong.