You've already forked AstralRinth
forked from didirus/AstralRinth
Create send function for API requests
This commit is contained in:
4
docs/dummyStore.ts
Normal file
4
docs/dummyStore.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { writable } from 'svelte/store'
|
||||
|
||||
// Used in `src/utils/send.ts`
|
||||
export const token = writable('')
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Built-in utilities
|
||||
---
|
||||
|
||||
## API requests
|
||||
|
||||
Use the `send` function to make API requests.
|
||||
|
||||
```svelte example raised
|
||||
<script lang="ts">
|
||||
import { send } from 'omorphia/utils'
|
||||
|
||||
const project = send<'getProject'>('GET', 'project/sodium')
|
||||
</script>
|
||||
|
||||
{#await project}
|
||||
fetching...
|
||||
{:then project}
|
||||
{project.downloads} downloads
|
||||
{/await}
|
||||
```
|
||||
|
||||
## Markdown
|
||||
|
||||
Use the markdown utilities to parse markdown text into HTML. Both markdown parsers have HTML sanitization built-in.
|
||||
|
||||
Reference in New Issue
Block a user