moves helpers to dedicated folder and adds input validation helper stores

This commit is contained in:
Keviin Åberg Kultalahti 2021-05-11 17:51:01 +02:00
parent 638e2f5c8e
commit e0993951b2
5 changed files with 7 additions and 5 deletions

View File

@ -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() {

View File

@ -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])

View File

@ -0,0 +1,2 @@
export { default as fetchData } from './fetchData'
export { buildStyle, convertCamel, pipe, capitalise, get_name, get_capitalised_name } from './helpers'

View File

@ -0,0 +1,2 @@
export { emailValidator, requiredValidator } from './validators'
export { createValidationStore } from './validation'

View File

@ -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"),