Get rid of domain module, allow app to override default event type

This commit is contained in:
Jon Staab
2024-08-13 15:45:20 -07:00
parent 5a63273b9d
commit 149c29472c
33 changed files with 201 additions and 285 deletions
+4 -2
View File
@@ -7,6 +7,8 @@ export type Nil = null | undefined
export const isNil = (x: any) => [null, undefined].includes(x)
export type Maybe<T> = T | undefined
// Regular old utils
export const now = () => Math.round(Date.now() / 1000)
@@ -95,9 +97,9 @@ export const stripProtocol = (url: string) => url.replace(/.*:\/\//, "")
export const sleep = (t: number) => new Promise(resolve => setTimeout(resolve, t))
export const concat = <T>(...xs: (T | Nil)[][]) => xs.flatMap(x => x || [])
export const concat = <T>(...xs: T[][]) => xs.flatMap(x => x || [])
export const append = <T>(x: T, xs: (T | Nil)[]) => concat(xs, [x])
export const append = <T>(x: T, xs: T[]) => concat(xs, [x])
export const union = <T>(a: T[], b: T[]) => uniq([...a, ...b])