rework context

This commit is contained in:
Jon Staab
2024-09-05 13:38:48 -07:00
parent 233a4e3576
commit 44f29c9da4
19 changed files with 157 additions and 138 deletions
+5
View File
@@ -0,0 +1,5 @@
import type {Context} from '@welshman/lib'
export const ctx: Context = {}
export const setContext = (newCtx: Context) => Object.assign(ctx, newCtx)
+2
View File
@@ -13,6 +13,8 @@ export type Maybe<T> = T | undefined
export const now = () => Math.round(Date.now() / 1000)
export const noop = (...args: unknown[]) => undefined
export const first = <T>(xs: T[], ...args: unknown[]) => xs[0]
export const last = <T>(xs: T[], ...args: unknown[]) => xs[xs.length - 1]
+1
View File
@@ -1,3 +1,4 @@
export * from './Context'
export * from './Deferred'
export * from './Emitter'
export * from './Fluent'
+3
View File
@@ -0,0 +1,3 @@
declare module "@welshman/lib" {
export interface Context {}
}