0.1.0 #1
@@ -170,29 +170,39 @@ export namespace make {
|
||||
i: (_: H, props: NoInfer<P>) => Effect.Effect<React.ReactNode, EOut, ROut>,
|
||||
): Component<EOut, ROut, P>
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
readonly untraced?: boolean
|
||||
readonly finalizerExecutionMode?: "sync" | "fork"
|
||||
readonly finalizerExecutionStrategy?: ExecutionStrategy.ExecutionStrategy
|
||||
}
|
||||
}
|
||||
|
||||
export const make: make.Gen = (...pipeables: readonly [any]) => {
|
||||
const displayName: string = !String.isEmpty(pipeables[0].name) ? pipeables[0].name : undefined
|
||||
|
||||
export const make: (
|
||||
& make.Gen
|
||||
& ((
|
||||
spanName: string,
|
||||
spanOptions?: Tracer.SpanOptions,
|
||||
) => make.Gen)
|
||||
) = (spanNameOrBody: Function | string, ...pipeables: any[]) => {
|
||||
if (typeof spanNameOrBody !== "string") {
|
||||
const displayName = displayNameFromBody(spanNameOrBody)
|
||||
return Object.setPrototypeOf({
|
||||
body: displayName
|
||||
? Effect.fn(displayName)(...pipeables)
|
||||
: Effect.fn(...pipeables),
|
||||
? Effect.fn(displayName)(spanNameOrBody as any, ...pipeables as [])
|
||||
: Effect.fn(spanNameOrBody as any, ...pipeables),
|
||||
displayName,
|
||||
}, ComponentProto)
|
||||
}
|
||||
|
||||
export const makeUntraced: make.Gen = (...pipeables: readonly [any]) => Object.setPrototypeOf({
|
||||
body: Effect.fnUntraced(...pipeables),
|
||||
displayName: !String.isEmpty(pipeables[0].name) ? pipeables[0].name : undefined,
|
||||
else {
|
||||
const spanOptions = pipeables[0]
|
||||
return (body: any, ...pipeables: any[]) => Object.setPrototypeOf({
|
||||
body: Effect.fn(spanNameOrBody, spanOptions)(body, ...pipeables as []),
|
||||
displayName: displayNameFromBody(body) ?? spanNameOrBody,
|
||||
}, ComponentProto)
|
||||
}
|
||||
}
|
||||
|
||||
export const makeUntraced: make.Gen = (body: Function, ...pipeables: any[]) => Object.setPrototypeOf({
|
||||
body: Effect.fnUntraced(body as any, ...pipeables as []),
|
||||
displayName: displayNameFromBody(body),
|
||||
}, ComponentProto)
|
||||
|
||||
const displayNameFromBody = (body: Function) => !String.isEmpty(body.name) ? body.name : undefined
|
||||
|
||||
|
||||
export const withRuntime: {
|
||||
|
||||
Reference in New Issue
Block a user