rework context
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import type {Context} from '@welshman/lib'
|
||||
|
||||
export const ctx: Context = {}
|
||||
|
||||
export const setContext = (newCtx: Context) => Object.assign(ctx, newCtx)
|
||||
@@ -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,3 +1,4 @@
|
||||
export * from './Context'
|
||||
export * from './Deferred'
|
||||
export * from './Emitter'
|
||||
export * from './Fluent'
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
declare module "@welshman/lib" {
|
||||
export interface Context {}
|
||||
}
|
||||
Reference in New Issue
Block a user