Skip to content

Commit

Permalink
Remove incorrect await usage from code example in fog of war post
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jul 18, 2024
1 parent 2052959 commit 719ab95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/posts/fog-of-war.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ You can expand on this async logic and move towards a manifest-like approach, no
```js
// Manifest mapping route prefixes to sub-app implementations
let manifest = {
account: () => await import("./account"),
dashboard: () => await import("./dashboard"),
"/account": () => import("./account"),
"/dashboard": () => import("./dashboard"),
};

let router = createBrowserRouter(
Expand All @@ -180,13 +180,13 @@ let router = createBrowserRouter(
],
{
async unstable_patchRoutesOnMiss({ path, patch }) {
let prefix = Object.keys(manifest).find((prefix) => path.startsWith(`/${prefix}`));
let prefix = Object.keys(manifest).find((p) => path.startsWith(p));
if (prefix) {
let children = await manifest[prefix]();
patch(null, children);
}
},
}
},
);
```

Expand Down

0 comments on commit 719ab95

Please sign in to comment.