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

Updated Svelte docs #145

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
new updates
fullstackmafia committed Jan 4, 2021
commit c9ff1ef801726c8faedf1d998d7cdbd34bc330e1
44 changes: 29 additions & 15 deletions frontend/docs/svelte.mdx
Original file line number Diff line number Diff line change
@@ -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.


<Tabs
defaultValue="svelte"
values={[
{label: 'Svelte + Fetch API', value: 'svelte-fetch'},
{label: 'Svelte + Axios', value: 'svelte-axios'},
]}>
<TabItem value="Svelte">

You can check out this example [on CodeSandbox](https://codesandbox.io/s/finalapi-svelte-urxd7).


:::note Code

// App.svelte
<style>
// App.svelte
```jsx
<style>
.parent {
align-items: center;
display: flex;
@@ -83,13 +91,16 @@ You can check out this example on CodeSandbox.
characters = await res.json();
});
</script>

```
:::
</TabItem>
<TabItem value="Svelte + Axios">

You can check out this example here on CodeSandbox.
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

<style>
@@ -145,8 +156,11 @@ To use this example, remember to add the Axios dependency to your project and in
});
});
</script>

```
:::

</TabItem>
</Tabs>



2 changes: 1 addition & 1 deletion frontend/sidebars.js
Original file line number Diff line number Diff line change
@@ -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"],
},
}