-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.json
46 lines (46 loc) · 1.21 KB
/
svelte.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"ui": {
"prefix": "freenit",
"body": [
"<script lang=\"ts\">",
" import { onMount } from 'svelte'",
" import { store } from '@freenit/core'",
" import { error } from '@freenit/svelte-base/notification'",
"",
" let loading = true",
"",
" onMount(async () => {",
" const response = await store.${1}.fetchAll()",
" if (!response.ok) {",
" error(response.statusText)",
" }",
" loading = false",
" })",
"",
" async function fetchPrevious() {",
" loading = true",
" const response = await store.${1}.fetchAll(store.${1}.list.page - 1)",
" if (!response.ok) {",
" error(response.statusText)",
" }",
" loading = false",
" }",
"",
" async function fetchNext() {",
" loading = true",
" const response = await store.${1}.fetchAll(store.${1}.list.page + 1)",
" if (!response.ok) {",
" error(response.statusText)",
" }",
" loading = false",
" }",
"</script>",
"",
"${0}",
"",
"<style>",
"</style>"
],
"description": "Freenit Svelte UI"
}
}