diff --git a/frontend/docs/svelte.mdx b/frontend/docs/svelte.mdx new file mode 100644 index 0000000..ff8b428 --- /dev/null +++ b/frontend/docs/svelte.mdx @@ -0,0 +1,167 @@ +--- + +id: svelte +title: Svelte +hide_title: false +hide_table_of_contents: false +keywords: + +- final space +- finalspace +- finalspaceapi +- final space wiki +- api +- restapi +- rest api +- example +- svelte +- axios +description: A live example of the Final Space API using Svelte alongside Axios to retrieve data. +--- + +The code samples below will show you how to implement the Final Space API using either the Fetch API or [Axios](https://www.npmjs.com/package/axios) in Svelte. + + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + + +You can check out this example [on CodeSandbox](https://codesandbox.io/s/finalapi-svelte-urxd7). + + +:::note Code + +```jsx + // App.svelte + + + +
+ {#each characters as character} +
+
+ {character.name} +

{character.name}

+
+ +
+ {:else} +

loading...

+ {/each} +
+ + +``` +::: +
+ + +You can check out this example [here on CodeSandbox](https://codesandbox.io/s/finalapi-svelte-axios-of957). +To use this example, remember to add the Axios dependency to your project and install it. + +:::note Code + +```jsx + // App.svelte + + + +
+ {#each characters as character} +
+
+ {character.name} +

{character.name}

+
+ +
+ {:else} +

loading...

+ {/each} +
+ + +``` + +
+
+ + + diff --git a/frontend/sidebars.js b/frontend/sidebars.js index e53b274..6c63618 100644 --- a/frontend/sidebars.js +++ b/frontend/sidebars.js @@ -1,7 +1,7 @@ module.exports = { someSidebar: { "Getting Started": ["intro", "character", "episode", "location", "quote"], - Examples: ["react", "vuejs", "javascript", "angular", "slider"], + Examples: ["react", "vuejs", "javascript", "angular", "slider", "svelte"], About: ["about"], }, }