Add store package

This commit is contained in:
Jon Staab
2024-08-01 15:33:37 -07:00
parent cfb0d01316
commit 7bb6d8c54a
10 changed files with 469 additions and 5 deletions
+4
View File
@@ -83,6 +83,10 @@ export const mapVals = <T extends Record<string, any>>(f: (v: any) => any, x: T)
return r as T
}
export const mergeLeft = <T extends Record<string, any>>(a: T, b: T) => ({...b, ...a})
export const mergeRight = <T extends Record<string, any>>(a: T, b: T) => ({...a, ...b})
export const between = (low: number, high: number, n: number) => n > low && n < high
export const randomId = (): string => Math.random().toString().slice(2)