Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
🐛 Attempt to fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
amoutonbrady committed Jan 2, 2021
1 parent 7457ea7 commit 65bc9ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const DefaultLoader: Component = () => <p>Loading...</p>;
const generateStore: GenerateStore = async ({ state, actions, props }) => {
const finalStore = await state(props);
const [get, set] = createState(finalStore);
const finalActions = actions(set, get);
const finalActions = actions ? actions(set, get) : {};

return [get, { ...finalActions, set }] as const;
};
Expand Down Expand Up @@ -112,7 +112,7 @@ export function createStore<
);

return (
<Show when={!value.loading} fallback={finalProps.loader || DefaultLoader}>
<Show when={!value.loading && value()} fallback={finalProps.loader || DefaultLoader}>
<Context.Provider {...external} value={value()}>
{internal.children}
</Context.Provider>
Expand Down

0 comments on commit 65bc9ec

Please sign in to comment.