MCPcopy Create free account
hub / github.com/Effect-TS/effect / success

Function success

packages/effect/src/unstable/reactivity/AsyncResult.ts:250–260  ·  view source on GitHub ↗
(value: A, options?: {
  readonly waiting?: boolean | undefined
  readonly timestamp?: number | undefined
})

Source from the content-addressed store, hash-verified

248 * @since 4.0.0
249 */
250export const success = <A, E = never>(value: A, options?: {
251 readonly waiting?: boolean | undefined
252 readonly timestamp?: number | undefined
253}): Success<A, E> => {
254 const result = Object.create(ResultProto)
255 result._tag = "Success"
256 result.value = value
257 result.waiting = options?.waiting ?? false
258 result.timestamp = options?.timestamp ?? Date.now()
259 return result
260}
261
262/**
263 * Failed `AsyncResult` containing a failure cause and the latest previous success when one is available.

Callers 7

fromExitFunction · 0.70
fromExitWithPreviousFunction · 0.70
touchFunction · 0.70
AsyncResult.tsFile · 0.70
allFunction · 0.70
SchemaFunction · 0.70
toCodecFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected