moves helpers to dedicated folder and adds input validation helper stores
This commit is contained in:
parent
638e2f5c8e
commit
e0993951b2
|
@ -1,7 +1,7 @@
|
|||
import { writable } from 'svelte/store'
|
||||
import api from "builderStore/api"
|
||||
|
||||
export function fetchData (url) {
|
||||
export default function (url) {
|
||||
const store = writable({status: 'LOADING', data: {}, error: {}})
|
||||
|
||||
async function get() {
|
|
@ -22,3 +22,5 @@ export const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1)
|
|||
export const get_name = s => (!s ? "" : last(s.split("/")))
|
||||
|
||||
export const get_capitalised_name = name => pipe(name, [get_name, capitalise])
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
export { default as fetchData } from './fetchData'
|
||||
export { buildStyle, convertCamel, pipe, capitalise, get_name, get_capitalised_name } from './helpers'
|
|
@ -0,0 +1,2 @@
|
|||
export { emailValidator, requiredValidator } from './validators'
|
||||
export { createValidationStore } from './validation'
|
|
@ -56,10 +56,6 @@ export default ({ mode }) => {
|
|||
find: "actions",
|
||||
replacement: path.resolve("./src/actions"),
|
||||
},
|
||||
{
|
||||
find: "helperStores",
|
||||
replacement: path.resolve("./src/helperStores"),
|
||||
},
|
||||
{
|
||||
find: "helpers",
|
||||
replacement: path.resolve("./src/helpers"),
|
||||
|
|
Loading…
Reference in New Issue