From 1007fec2a1c50b0bbf732938e89c239421592b4a Mon Sep 17 00:00:00 2001 From: fullstackmafia Date: Mon, 4 Jan 2021 18:09:32 +0400 Subject: [PATCH 1/4] Updated Svelte docs --- frontend/docs/svelte.mdx | 152 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 frontend/docs/svelte.mdx diff --git a/frontend/docs/svelte.mdx b/frontend/docs/svelte.mdx new file mode 100644 index 0000000..2c074ef --- /dev/null +++ b/frontend/docs/svelte.mdx @@ -0,0 +1,152 @@ + + +---------- + +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'; +defaultValue="svelte" +values={[ +{label: 'Svelte + Fetch API', value: 'svelte-fetch'}, +{label: 'Svelte + Axios', value: 'svelte-axios'}, +]}> +You can check out this example on CodeSandbox. +:::note Code + + // App.svelte + + + +
+ {#each characters as character} +
+
+ {character.name} +

{character.name}

+
+ +
+ {:else} +

loading...

+ {/each} +
+ + + +::: + +You can check out this example here on CodeSandbox. +To use this example, remember to add the Axios dependency to your project and install it. +:::note Code + + // App.svelte + + + +
+ {#each characters as character} +
+
+ {character.name} +

{character.name}

+
+ +
+ {:else} +

loading...

+ {/each} +
+ + + +::: + + + From c9ff1ef801726c8faedf1d998d7cdbd34bc330e1 Mon Sep 17 00:00:00 2001 From: fullstackmafia Date: Mon, 4 Jan 2021 18:28:59 +0400 Subject: [PATCH 2/4] new updates --- frontend/docs/svelte.mdx | 44 ++++++++++++++++++++++++++-------------- frontend/sidebars.js | 2 +- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/frontend/docs/svelte.mdx b/frontend/docs/svelte.mdx index 2c074ef..fb6704c 100644 --- a/frontend/docs/svelte.mdx +++ b/frontend/docs/svelte.mdx @@ -1,6 +1,4 @@ - - ----------- +--- id: svelte title: Svelte @@ -19,21 +17,31 @@ keywords: - 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'; -defaultValue="svelte" -values={[ -{label: 'Svelte + Fetch API', value: 'svelte-fetch'}, -{label: 'Svelte + Axios', value: 'svelte-axios'}, -]}> -You can check out this example on CodeSandbox. + + + + + +You can check out this example [on CodeSandbox](https://codesandbox.io/s/finalapi-svelte-urxd7). + + :::note Code - // App.svelte - -