budibase/packages/builder/src/stores/portal/templates.js

17 lines
324 B
JavaScript
Raw Normal View History

2021-12-14 16:58:19 +01:00
import { writable } from "svelte/store"
import { API } from "api"
2021-12-14 16:58:19 +01:00
export function templatesStore() {
const { subscribe, set } = writable([])
return {
subscribe,
load: async () => {
const templates = await API.getAppTemplates()
set(templates)
},
2021-12-14 16:58:19 +01:00
}
}
export const templates = templatesStore()