Skip to content

Commit

Permalink
🎨 [Format] Websites store folder
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Jul 31, 2024
1 parent 1b0acbb commit 1ef08e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/website/src/store/useDebugManager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {computed, ref} from 'vue';
import {type ManagerEventMap} from 'earwurm';
import type {ManagerEventMap} from 'earwurm';

import {useEarwurmStore} from './useEarwurmStore';

Expand Down
8 changes: 5 additions & 3 deletions app/website/src/store/useEarwurmStore.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {computed, ref, watch} from 'vue';
import {Earwurm} from 'earwurm';

import type {SynthType, SynthEntries} from '@/types';
import type {SynthEntries, SynthType} from '@/types';
import {filterSynthValues} from '@/helpers';
import {useMetronome} from '@/hooks';
import {audioPath} from '@/assets/audio';
Expand Down Expand Up @@ -75,7 +75,8 @@ export function useEarwurmStore() {

if (metronomeRef.value) {
metroInstance.start();
} else {
}
else {
metroInstance.stop();
}
},
Expand All @@ -99,7 +100,8 @@ export function useEarwurmStore() {
///
/// Mutations

addStack(id: SynthType) {
// Instead of an arrow function, we could use `this: void`.
addStack: (id: SynthType) => {
if (manager.get(id)) return;

const stackEntry = audioLibrary.find((entry) => entry.id === id);
Expand Down
9 changes: 5 additions & 4 deletions app/website/src/store/useSound.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {computed, ref, watch} from 'vue';
import type {SoundId, SoundEventMap} from 'earwurm';
import type {SoundEventMap, SoundId} from 'earwurm';

import type {SynthType} from '@/types';
import {useEarwurmStore} from './useEarwurmStore';
import type {SynthType} from '@/types';

const {manager} = useEarwurmStore();

Expand Down Expand Up @@ -84,7 +84,8 @@ export function useSound(id: SoundId, stackId: SynthType) {

if (sound.state === 'playing') {
sound.pause();
} else {
}
else {
sound.play();
}
}
Expand All @@ -106,7 +107,7 @@ export function useSound(id: SoundId, stackId: SynthType) {

const reversedRef = ref(false);

// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line unused-imports/no-unused-vars
function toggleReverse() {
reversedRef.value = !reversedRef.value;
}
Expand Down
4 changes: 2 additions & 2 deletions app/website/src/store/useStack.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {computed, ref, watch} from 'vue';
import type {StackEventMap} from 'earwurm';

import type {SynthType} from '@/types';
import {useEarwurmStore} from './useEarwurmStore';
import type {SynthType} from '@/types';

const {addStack, manager} = useEarwurmStore();

Expand Down Expand Up @@ -106,7 +106,7 @@ export function useStack(id: SynthType) {
stack.on('queue', handleQueueChange);
stack.on('mute', handleMuteChange);

addSound();
void addSound();
}

return {
Expand Down

0 comments on commit 1ef08e6

Please sign in to comment.