Priority/frontend.light/src/lib/stores/priority.js
2024-01-17 12:43:34 +01:00

48 lines
No EOL
1.4 KiB
JavaScript

import { writable } from 'svelte/store';
function createPriority() {
const { subscribe, set, update } = writable({
surfers: [
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
],
round: {
name: '',
heat: 1,
category: ''
},
surfersCount: 4
});
const clear = () => {
set({
surfers: [
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
{ color: 'lightgray', priority: '', name: '' },
],
round: {
name: '',
heat: 1,
category: ''
},
surfersCount: 4
});
};
return {
subscribe,
set,
update,
clear
}
}
export const priorityStore = createPriority();