Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use static View.availableEnvironments #33

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo-snippets/guides/views/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { mesh } = createSphereObject();

export async function main(view: View) {
const envIndexUrl = new URL("https://api.novorender.com/assets/env/index.json");
const envs = await view.availableEnvironments(envIndexUrl);
const envs = await View.availableEnvironments(envIndexUrl);
const { url } = envs[2]; // just pick one
view.modifyRenderState({
background: { url, blur: 0 }, // may take a while to download
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/views.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ The view contains a function <CodeLink type="class" name="View.availableEnvironm
We've already included some environments on our `api.novorender.com` server, so that's were we'll point it to.

```typescript
const envs = await view.availableEnvironments("https://api.novorender.com/assets/env/index.json");
const envs = await View.availableEnvironments("https://api.novorender.com/assets/env/index.json");
const {url} = envs[0];
view.modifyRenderState({ background: { url } });
```
Expand Down