48 lines
No EOL
1.4 KiB
JavaScript
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(); |