Run prettier on Typescript files

Port 51b83ed195 to glitch-soc
This commit is contained in:
Claire
2023-05-09 23:41:18 +02:00
parent facc7ab03c
commit 96e99e2170
24 changed files with 373 additions and 195 deletions

View File

@@ -2,8 +2,8 @@ import { Middleware, AnyAction } from 'redux';
import { RootState } from '..';
interface AudioSource {
src: string
type: string
src: string;
type: string;
}
const createAudio = (sources: AudioSource[]) => {
@@ -30,8 +30,11 @@ const play = (audio: HTMLAudioElement) => {
audio.play();
};
export const soundsMiddleware = (): Middleware<Record<string, never>, RootState> => {
const soundCache: {[key: string]: HTMLAudioElement} = {
export const soundsMiddleware = (): Middleware<
Record<string, never>,
RootState
> => {
const soundCache: { [key: string]: HTMLAudioElement } = {
boop: createAudio([
{
src: '/sounds/boop.ogg',
@@ -44,7 +47,7 @@ export const soundsMiddleware = (): Middleware<Record<string, never>, RootState
]),
};
return () => next => (action: AnyAction) => {
return () => (next) => (action: AnyAction) => {
const sound = action?.meta?.sound;
if (sound && soundCache[sound]) {