mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-13 17:25:36 +02:00
⭐ feat(www): Finish up on the onboarding (#210)
Merging this prematurely to make sure the team is on the same boat... like dang! We need to find a better way to do this. Plus it has become too big
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ParentProps, Show, createContext, useContext } from "solid-js";
|
||||
import { JSX, ParentProps, Show, createContext, useContext } from "solid-js";
|
||||
|
||||
export function createInitializedContext<
|
||||
Name extends string,
|
||||
@@ -12,10 +12,12 @@ export function createInitializedContext<
|
||||
if (!context) throw new Error(`No ${name} context`);
|
||||
return context;
|
||||
},
|
||||
provider: (props: ParentProps) => {
|
||||
provider: (props: ParentProps & { loadingUI?: JSX.Element }) => {
|
||||
const value = cb();
|
||||
return (
|
||||
<Show when={value.ready}>
|
||||
<Show
|
||||
fallback={props.loadingUI}
|
||||
when={value.ready}>
|
||||
<ctx.Provider value={value} {...props}>
|
||||
{props.children}
|
||||
</ctx.Provider>
|
||||
|
||||
Reference in New Issue
Block a user