effect 4.0.0-beta.69 → 4.0.0-beta.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Array.d.ts +454 -0
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +152 -0
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +87 -33
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +37 -11
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +71 -14
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +35 -10
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +4 -0
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +4 -0
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +16 -11
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +16 -11
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +13 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +8 -0
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +95 -3
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +56 -2
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +312 -0
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +126 -0
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +20 -0
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +12 -0
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +59 -22
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +29 -10
- package/dist/Chunk.js.map +1 -1
- package/dist/Combiner.d.ts +75 -71
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +67 -62
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +167 -46
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +108 -28
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +235 -158
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +144 -93
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +21 -79
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +20 -75
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +4 -4
- package/dist/Context.js +2 -2
- package/dist/Cron.d.ts +42 -16
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +33 -13
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +6 -0
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +132 -70
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +44 -29
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +227 -14
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +115 -6
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +94 -27
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +33 -8
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +2 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +64 -6
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +26 -2
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +907 -603
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +360 -233
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +3 -1
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -1
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +16 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +16 -0
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +52 -40
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +32 -26
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +190 -153
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +129 -104
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +35 -14
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +18 -6
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +10 -3
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +4 -3
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +212 -6
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +139 -2
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +8 -0
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +4 -0
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +46 -23
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +27 -11
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +43 -4
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +27 -4
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +21 -6
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +17 -6
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +64 -0
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +26 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +53 -21
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +20 -9
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +21 -22
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +12 -12
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +67 -75
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +29 -19
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +51 -13
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +19 -3
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +22 -21
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +33 -10
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +27 -10
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +50 -9
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +17 -3
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +4 -0
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +2 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +2 -0
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +15 -2
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +11 -2
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +104 -22
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +46 -12
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +61 -80
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +35 -42
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +16 -20
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +16 -20
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +123 -73
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +95 -53
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +28 -2
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +22 -2
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +781 -335
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +324 -129
- package/dist/Layer.js.map +1 -1
- package/dist/LogLevel.d.ts +86 -13
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +30 -4
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +63 -51
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +61 -51
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +12 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +1 -0
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +83 -1
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +31 -1
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +89 -12
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +53 -8
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +14 -0
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +4 -0
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +2 -0
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +24 -6
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +22 -6
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +2 -0
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +69 -30
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +52 -22
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +6 -0
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +2 -0
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +16 -30
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +6 -12
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +90 -40
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +48 -24
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +121 -111
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +56 -54
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +169 -167
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +135 -135
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +4 -0
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +2 -0
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +7 -5
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +5 -5
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +8 -0
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +4 -0
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +10 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +8 -0
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +12 -0
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +10 -0
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +30 -16
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +30 -16
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +520 -352
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +271 -184
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +4 -0
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +2 -0
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +22 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +17 -3
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +16 -0
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +10 -0
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +44 -0
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +28 -0
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +25 -6
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +11 -2
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +10 -6
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +2 -2
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +3 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +24 -3
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +12 -3
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +54 -41
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +42 -32
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +10 -0
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +6 -0
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +20 -11
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +10 -6
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +45 -24
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +41 -21
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +18 -1
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +17 -1
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +3 -3
- package/dist/Request.js +2 -2
- package/dist/RequestResolver.d.ts +7 -17
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +3 -5
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +2 -0
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +2 -0
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +188 -6
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +84 -2
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +14 -11
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +11 -9
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +27 -3
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +21 -2
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +22 -19
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +14 -12
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +547 -130
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +409 -121
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +123 -65
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +90 -39
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +269 -234
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +245 -215
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +48 -46
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +34 -34
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +58 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +58 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +198 -96
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +107 -45
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +272 -203
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +249 -187
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +2 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +2 -0
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +18 -0
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +44 -0
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +18 -0
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +9 -3
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +3 -1
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +6 -0
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +4 -0
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +108 -0
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +54 -0
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +7 -3
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +2 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +416 -16
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +164 -8
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +14 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +6 -0
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +371 -191
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +144 -77
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +7 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +5 -1
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -0
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -0
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Tracer.d.ts +17 -27
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +8 -12
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +23 -9
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +13 -3
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +287 -144
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +135 -66
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +182 -93
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +68 -35
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +3 -4
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +163 -86
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +57 -30
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +24 -27
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +9 -6
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +2 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +36 -35
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +22 -21
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +77 -114
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +45 -62
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxRef.d.ts +4 -0
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +2 -0
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +66 -27
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +38 -15
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/Types.d.ts +202 -75
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +31 -29
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +27 -21
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +28 -0
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +2 -0
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +29 -35
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +11 -13
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +18 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/testing/TestClock.d.ts +17 -17
- package/dist/testing/TestClock.js +1 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +2 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +43 -55
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +43 -55
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +62 -11
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +58 -11
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +4 -4
- package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -4
- package/dist/unstable/ai/Chat.d.ts +29 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +15 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +10 -0
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +8 -0
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +32 -46
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +5 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +84 -32
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +73 -28
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +8 -0
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +6 -0
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +9 -5
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +4 -0
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +3 -2
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +3 -2
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +62 -35
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +16 -15
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +40 -21
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +10 -0
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +8 -0
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +4 -0
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +30 -5
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +7 -1
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +6 -0
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +4 -0
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +68 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +36 -0
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +12 -0
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +6 -0
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +14 -4
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +4 -0
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +6 -0
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +4 -0
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +123 -12
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +57 -4
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +31 -14
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +23 -10
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +10 -0
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +46 -5
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +10 -0
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +10 -0
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +47 -40
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +25 -20
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +1 -0
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +10 -2
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +3 -0
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +8 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +10 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +2 -0
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -0
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +8 -0
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +4 -0
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +4 -0
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +3 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +24 -0
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +12 -0
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +10 -4
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +6 -0
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +4 -0
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +10 -0
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +8 -0
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +16 -0
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +10 -0
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +16 -0
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +16 -0
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +8 -0
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +8 -0
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +24 -0
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +18 -0
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +64 -20
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -0
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +6 -6
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -3
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +2 -0
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +2 -0
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +13 -2
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +13 -2
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +8 -8
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +8 -8
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +2 -0
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +2 -0
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +4 -0
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +4 -0
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +2 -0
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +2 -0
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +3 -2
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +3 -2
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +34 -2
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +14 -0
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +4 -0
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +2 -0
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +24 -0
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +18 -0
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +46 -2
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +30 -2
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +24 -17
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +20 -11
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +16 -0
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +4 -0
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +2 -0
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +20 -0
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +18 -0
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +22 -0
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +18 -0
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +10 -0
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +10 -0
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +4 -0
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +4 -0
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +4 -0
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +4 -0
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +6 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +6 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +8 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +8 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +11 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +11 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +2 -0
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +2 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +34 -0
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +18 -0
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +4 -0
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +4 -0
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +4 -0
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +60 -0
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +24 -0
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +32 -0
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +22 -0
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +44 -0
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +14 -0
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +2 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +6 -0
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +6 -0
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +4 -0
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +4 -0
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +2 -0
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +2 -0
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +54 -16
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +26 -1
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +35 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +17 -1
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +17 -3
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +16 -0
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +30 -0
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +28 -0
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +8 -0
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +6 -0
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +96 -0
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +50 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +12 -0
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +10 -0
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +49 -2
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +35 -2
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +14 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +4 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +64 -0
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +28 -0
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +10 -4
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +4 -0
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +9 -4
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +5 -4
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +2 -0
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +2 -0
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +23 -14
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +6 -3
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +14 -0
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +6 -0
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +38 -15
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +4 -0
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +14 -3
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +10 -0
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +17 -11
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +17 -11
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +2 -4
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +2 -4
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +2 -0
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +2 -0
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +2 -0
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +2 -0
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +2 -0
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +2 -0
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -0
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -0
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -0
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +4 -0
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +8 -9
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +3 -3
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +8 -0
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +8 -0
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +3 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +3 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +6 -2
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +6 -2
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +10 -0
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +8 -0
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -0
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +2 -0
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +2 -0
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -0
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +21 -6
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +10 -0
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +14 -0
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +14 -0
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +6 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +4 -0
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +6 -0
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +4 -0
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +70 -19
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +10 -0
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +20 -4
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +105 -14
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +53 -8
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +4 -0
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +2 -0
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +8 -0
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +2 -0
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +32 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +12 -0
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +8 -6
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +4 -3
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +4 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +27 -3
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +15 -3
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +38 -2
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +12 -2
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +6 -0
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +6 -0
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +5 -3
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +5 -3
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +43 -12
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +41 -12
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +6 -4
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +6 -4
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +8 -4
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +3 -0
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +3 -0
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +42 -34
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +18 -19
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +454 -0
- package/src/BigDecimal.ts +87 -33
- package/src/BigInt.ts +71 -14
- package/src/Boolean.ts +4 -0
- package/src/Brand.ts +16 -11
- package/src/Cache.ts +17 -1
- package/src/Cause.ts +95 -3
- package/src/Channel.ts +326 -0
- package/src/ChannelSchema.ts +24 -0
- package/src/Chunk.ts +59 -22
- package/src/Combiner.ts +75 -71
- package/src/Config.ts +167 -46
- package/src/ConfigProvider.ts +235 -158
- package/src/Console.ts +25 -99
- package/src/Context.ts +4 -4
- package/src/Cron.ts +42 -16
- package/src/Crypto.ts +6 -0
- package/src/Data.ts +132 -70
- package/src/DateTime.ts +227 -14
- package/src/Deferred.ts +94 -27
- package/src/Differ.ts +2 -0
- package/src/Duration.ts +64 -6
- package/src/Effect.ts +909 -605
- package/src/Effectable.ts +3 -1
- package/src/Encoding.ts +16 -0
- package/src/Equal.ts +52 -40
- package/src/Equivalence.ts +190 -153
- package/src/ErrorReporter.ts +35 -14
- package/src/ExecutionPlan.ts +10 -3
- package/src/Exit.ts +212 -6
- package/src/Fiber.ts +8 -0
- package/src/FiberHandle.ts +46 -23
- package/src/FiberMap.ts +43 -4
- package/src/FiberSet.ts +21 -6
- package/src/FileSystem.ts +64 -0
- package/src/Filter.ts +53 -21
- package/src/Formatter.ts +21 -22
- package/src/Function.ts +67 -75
- package/src/Graph.ts +51 -13
- package/src/HKT.ts +22 -21
- package/src/Hash.ts +33 -10
- package/src/HashMap.ts +50 -9
- package/src/HashRing.ts +4 -0
- package/src/HashSet.ts +2 -0
- package/src/Inspectable.ts +15 -2
- package/src/Iterable.ts +104 -22
- package/src/JsonPatch.ts +61 -80
- package/src/JsonPointer.ts +16 -20
- package/src/JsonSchema.ts +123 -73
- package/src/Latch.ts +28 -2
- package/src/Layer.ts +781 -335
- package/src/LogLevel.ts +86 -13
- package/src/Logger.ts +71 -51
- package/src/ManagedRuntime.ts +12 -0
- package/src/Match.ts +83 -1
- package/src/Metric.ts +105 -12
- package/src/MutableHashMap.ts +18 -0
- package/src/MutableHashSet.ts +2 -0
- package/src/MutableList.ts +24 -6
- package/src/MutableRef.ts +2 -0
- package/src/Newtype.ts +69 -30
- package/src/NonEmptyIterable.ts +6 -0
- package/src/Number.ts +16 -30
- package/src/Optic.ts +90 -40
- package/src/Option.ts +121 -111
- package/src/Order.ts +169 -167
- package/src/Ordering.ts +4 -0
- package/src/PartitionedSemaphore.ts +7 -5
- package/src/Path.ts +8 -0
- package/src/Pipeable.ts +10 -0
- package/src/PlatformError.ts +12 -0
- package/src/Pool.ts +30 -16
- package/src/Predicate.ts +520 -352
- package/src/PrimaryKey.ts +4 -0
- package/src/PubSub.ts +23 -5
- package/src/Pull.ts +16 -0
- package/src/Queue.ts +44 -0
- package/src/Random.ts +25 -6
- package/src/RcMap.ts +10 -6
- package/src/RcRef.ts +3 -1
- package/src/Record.ts +24 -3
- package/src/Redactable.ts +54 -41
- package/src/Redacted.ts +10 -0
- package/src/Reducer.ts +20 -11
- package/src/Ref.ts +95 -58
- package/src/References.ts +18 -1
- package/src/Request.ts +3 -3
- package/src/RequestResolver.ts +8 -22
- package/src/Resource.ts +2 -0
- package/src/Result.ts +192 -6
- package/src/Runtime.ts +14 -11
- package/src/Schedule.ts +35 -3
- package/src/Scheduler.ts +22 -19
- package/src/Schema.ts +547 -130
- package/src/SchemaAST.ts +123 -65
- package/src/SchemaGetter.ts +269 -234
- package/src/SchemaIssue.ts +48 -46
- package/src/SchemaParser.ts +58 -0
- package/src/SchemaRepresentation.ts +198 -96
- package/src/SchemaTransformation.ts +272 -203
- package/src/SchemaUtils.ts +2 -0
- package/src/Scope.ts +19 -1
- package/src/ScopedCache.ts +56 -0
- package/src/ScopedRef.ts +9 -3
- package/src/Semaphore.ts +6 -0
- package/src/Sink.ts +108 -0
- package/src/Stdio.ts +7 -3
- package/src/Stream.ts +464 -16
- package/src/String.ts +14 -0
- package/src/Struct.ts +371 -191
- package/src/SubscriptionRef.ts +7 -1
- package/src/SynchronizedRef.ts +2 -0
- package/src/Tracer.ts +17 -27
- package/src/Trie.ts +23 -9
- package/src/Tuple.ts +287 -144
- package/src/TxChunk.ts +182 -93
- package/src/TxDeferred.ts +3 -4
- package/src/TxHashMap.ts +171 -90
- package/src/TxHashSet.ts +36 -35
- package/src/TxPriorityQueue.ts +2 -0
- package/src/TxPubSub.ts +36 -35
- package/src/TxQueue.ts +77 -114
- package/src/TxRef.ts +4 -0
- package/src/TxSemaphore.ts +66 -27
- package/src/Types.ts +202 -75
- package/src/UndefinedOr.ts +31 -29
- package/src/Unify.ts +28 -0
- package/src/Utils.ts +29 -35
- package/src/index.ts +18 -7
- package/src/testing/TestClock.ts +16 -16
- package/src/testing/TestConsole.ts +2 -0
- package/src/testing/TestSchema.ts +43 -55
- package/src/unstable/ai/AiError.ts +62 -11
- package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -4
- package/src/unstable/ai/Chat.ts +29 -1
- package/src/unstable/ai/IdGenerator.ts +10 -0
- package/src/unstable/ai/LanguageModel.ts +32 -46
- package/src/unstable/ai/McpSchema.ts +84 -32
- package/src/unstable/ai/McpServer.ts +8 -0
- package/src/unstable/ai/Model.ts +9 -5
- package/src/unstable/ai/OpenAiStructuredOutput.ts +3 -2
- package/src/unstable/ai/Prompt.ts +62 -35
- package/src/unstable/ai/Response.ts +40 -21
- package/src/unstable/ai/ResponseIdTracker.ts +8 -0
- package/src/unstable/ai/Telemetry.ts +30 -5
- package/src/unstable/ai/Tokenizer.ts +6 -0
- package/src/unstable/ai/Tool.ts +68 -0
- package/src/unstable/ai/Toolkit.ts +12 -0
- package/src/unstable/cli/Argument.ts +14 -4
- package/src/unstable/cli/CliError.ts +6 -0
- package/src/unstable/cli/Command.ts +128 -12
- package/src/unstable/cli/Flag.ts +31 -14
- package/src/unstable/cli/Param.ts +96 -9
- package/src/unstable/cli/Primitive.ts +10 -0
- package/src/unstable/cli/Prompt.ts +47 -40
- package/src/unstable/cli/internal/command.ts +11 -2
- package/src/unstable/cli/internal/completions/descriptor.ts +3 -0
- package/src/unstable/cli/internal/parser.ts +8 -1
- package/src/unstable/cluster/ClusterCron.ts +10 -1
- package/src/unstable/cluster/ClusterSchema.ts +8 -0
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -0
- package/src/unstable/cluster/DeliverAt.ts +3 -4
- package/src/unstable/cluster/Entity.ts +24 -0
- package/src/unstable/cluster/EntityProxy.ts +10 -4
- package/src/unstable/cluster/EntityProxyServer.ts +6 -0
- package/src/unstable/cluster/EntityResource.ts +10 -0
- package/src/unstable/cluster/Envelope.ts +16 -0
- package/src/unstable/cluster/HttpRunner.ts +16 -0
- package/src/unstable/cluster/K8sHttpClient.ts +8 -0
- package/src/unstable/cluster/Message.ts +24 -0
- package/src/unstable/cluster/MessageStorage.ts +44 -10
- package/src/unstable/cluster/Reply.ts +6 -6
- package/src/unstable/cluster/Runner.ts +2 -0
- package/src/unstable/cluster/RunnerHealth.ts +13 -2
- package/src/unstable/cluster/RunnerServer.ts +8 -8
- package/src/unstable/cluster/RunnerStorage.ts +2 -0
- package/src/unstable/cluster/ShardId.ts +4 -0
- package/src/unstable/cluster/Snowflake.ts +2 -0
- package/src/unstable/cluster/TestRunner.ts +3 -2
- package/src/unstable/devtools/DevToolsSchema.ts +34 -2
- package/src/unstable/devtools/DevToolsServer.ts +4 -0
- package/src/unstable/encoding/Msgpack.ts +24 -0
- package/src/unstable/encoding/Ndjson.ts +46 -2
- package/src/unstable/encoding/Sse.ts +24 -17
- package/src/unstable/eventlog/Event.ts +16 -0
- package/src/unstable/eventlog/EventGroup.ts +4 -0
- package/src/unstable/eventlog/EventJournal.ts +20 -0
- package/src/unstable/eventlog/EventLog.ts +22 -0
- package/src/unstable/eventlog/EventLogMessage.ts +10 -0
- package/src/unstable/eventlog/EventLogRemote.ts +4 -0
- package/src/unstable/eventlog/EventLogServer.ts +4 -0
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +6 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +8 -0
- package/src/unstable/eventlog/EventLogSessionAuth.ts +11 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +2 -0
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +2 -0
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +2 -0
- package/src/unstable/http/Cookies.ts +34 -0
- package/src/unstable/http/Etag.ts +4 -0
- package/src/unstable/http/FetchHttpClient.ts +4 -0
- package/src/unstable/http/Headers.ts +88 -0
- package/src/unstable/http/HttpBody.ts +32 -0
- package/src/unstable/http/HttpClient.ts +44 -0
- package/src/unstable/http/HttpClientRequest.ts +2 -0
- package/src/unstable/http/HttpClientResponse.ts +6 -0
- package/src/unstable/http/HttpEffect.ts +4 -0
- package/src/unstable/http/HttpPlatform.ts +2 -0
- package/src/unstable/http/HttpRouter.ts +54 -16
- package/src/unstable/http/HttpServer.ts +35 -1
- package/src/unstable/http/HttpServerError.ts +17 -3
- package/src/unstable/http/HttpServerRequest.ts +30 -0
- package/src/unstable/http/HttpServerRespondable.ts +8 -0
- package/src/unstable/http/HttpServerResponse.ts +96 -0
- package/src/unstable/http/HttpTraceContext.ts +12 -0
- package/src/unstable/http/Multipart.ts +49 -2
- package/src/unstable/http/Template.ts +14 -0
- package/src/unstable/http/UrlParams.ts +64 -0
- package/src/unstable/httpapi/HttpApi.ts +10 -4
- package/src/unstable/httpapi/HttpApiBuilder.ts +9 -4
- package/src/unstable/httpapi/HttpApiEndpoint.ts +2 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +23 -14
- package/src/unstable/httpapi/HttpApiMiddleware.ts +14 -0
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -15
- package/src/unstable/httpapi/HttpApiSchema.ts +14 -3
- package/src/unstable/httpapi/HttpApiSecurity.ts +17 -11
- package/src/unstable/httpapi/HttpApiSwagger.ts +2 -4
- package/src/unstable/httpapi/HttpApiTest.ts +2 -0
- package/src/unstable/httpapi/OpenApi.ts +2 -0
- package/src/unstable/observability/Otlp.ts +2 -0
- package/src/unstable/observability/OtlpExporter.ts +2 -0
- package/src/unstable/observability/OtlpLogger.ts +4 -0
- package/src/unstable/observability/OtlpMetrics.ts +8 -9
- package/src/unstable/observability/OtlpResource.ts +8 -0
- package/src/unstable/observability/OtlpTracer.ts +3 -2
- package/src/unstable/observability/PrometheusMetrics.ts +6 -2
- package/src/unstable/persistence/KeyValueStore.ts +10 -0
- package/src/unstable/persistence/Persistable.ts +2 -0
- package/src/unstable/persistence/PersistedCache.ts +2 -0
- package/src/unstable/persistence/PersistedQueue.ts +21 -6
- package/src/unstable/persistence/Persistence.ts +14 -0
- package/src/unstable/persistence/RateLimiter.ts +6 -3
- package/src/unstable/persistence/Redis.ts +6 -0
- package/src/unstable/process/ChildProcess.ts +70 -19
- package/src/unstable/process/ChildProcessSpawner.ts +20 -4
- package/src/unstable/reactivity/Atom.ts +119 -14
- package/src/unstable/reactivity/AtomHttpApi.ts +4 -0
- package/src/unstable/reactivity/AtomRef.ts +8 -0
- package/src/unstable/reactivity/AtomRegistry.ts +34 -0
- package/src/unstable/reactivity/AtomRpc.ts +8 -6
- package/src/unstable/reactivity/Hydration.ts +6 -0
- package/src/unstable/reactivity/Reactivity.ts +27 -3
- package/src/unstable/rpc/Rpc.ts +38 -2
- package/src/unstable/rpc/RpcSerialization.ts +6 -0
- package/src/unstable/rpc/RpcServer.ts +5 -3
- package/src/unstable/schema/Model.ts +43 -12
- package/src/unstable/sql/SqlClient.ts +1 -1
- package/src/unstable/sql/SqlResolver.ts +6 -4
- package/src/unstable/sql/Statement.ts +8 -4
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +3 -0
- package/src/unstable/workflow/Workflow.ts +42 -34
package/src/Effect.ts
CHANGED
|
@@ -154,6 +154,8 @@ export const TypeId: TypeId = core.EffectTypeId
|
|
|
154
154
|
* job. The workflow requires some context `R`, and may fail with an error of
|
|
155
155
|
* type `E`, or succeed with a value of type `A`.
|
|
156
156
|
*
|
|
157
|
+
* **Details**
|
|
158
|
+
*
|
|
157
159
|
* `Effect` values model resourceful interaction with the outside world,
|
|
158
160
|
* including synchronous, asynchronous, concurrent, and parallel interaction.
|
|
159
161
|
* They use a fiber-based concurrency model, with built-in support for
|
|
@@ -407,7 +409,7 @@ export declare namespace All {
|
|
|
407
409
|
* first failure; with concurrent execution, effects that have already started
|
|
408
410
|
* may be interrupted, while effects not yet started are skipped.
|
|
409
411
|
*
|
|
410
|
-
*
|
|
412
|
+
* Options:
|
|
411
413
|
*
|
|
412
414
|
* Use `concurrency` to control sequential or concurrent execution. Use
|
|
413
415
|
* `mode: "result"` to run every effect and collect each success or failure as a
|
|
@@ -521,7 +523,6 @@ export declare namespace All {
|
|
|
521
523
|
* ```
|
|
522
524
|
*
|
|
523
525
|
* @see {@link forEach} for iterating over elements and applying an effect.
|
|
524
|
-
*
|
|
525
526
|
* @category Collecting
|
|
526
527
|
* @since 2.0.0
|
|
527
528
|
*/
|
|
@@ -543,6 +544,8 @@ export const all: <
|
|
|
543
544
|
* Applies an effectful function to each element and partitions failures and
|
|
544
545
|
* successes.
|
|
545
546
|
*
|
|
547
|
+
* **Details**
|
|
548
|
+
*
|
|
546
549
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
547
550
|
*
|
|
548
551
|
* - `excluded` contains all failures.
|
|
@@ -572,6 +575,8 @@ export const partition: {
|
|
|
572
575
|
* Applies an effectful function to each element and partitions failures and
|
|
573
576
|
* successes.
|
|
574
577
|
*
|
|
578
|
+
* **Details**
|
|
579
|
+
*
|
|
575
580
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
576
581
|
*
|
|
577
582
|
* - `excluded` contains all failures.
|
|
@@ -604,6 +609,8 @@ export const partition: {
|
|
|
604
609
|
* Applies an effectful function to each element and partitions failures and
|
|
605
610
|
* successes.
|
|
606
611
|
*
|
|
612
|
+
* **Details**
|
|
613
|
+
*
|
|
607
614
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
608
615
|
*
|
|
609
616
|
* - `excluded` contains all failures.
|
|
@@ -638,6 +645,8 @@ export const partition: {
|
|
|
638
645
|
/**
|
|
639
646
|
* Applies an effectful function to each element and accumulates all failures.
|
|
640
647
|
*
|
|
648
|
+
* **Details**
|
|
649
|
+
*
|
|
641
650
|
* This function always evaluates every element. If at least one effect fails,
|
|
642
651
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
643
652
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -675,6 +684,8 @@ export const validate: {
|
|
|
675
684
|
/**
|
|
676
685
|
* Applies an effectful function to each element and accumulates all failures.
|
|
677
686
|
*
|
|
687
|
+
* **Details**
|
|
688
|
+
*
|
|
678
689
|
* This function always evaluates every element. If at least one effect fails,
|
|
679
690
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
680
691
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -718,6 +729,8 @@ export const validate: {
|
|
|
718
729
|
/**
|
|
719
730
|
* Applies an effectful function to each element and accumulates all failures.
|
|
720
731
|
*
|
|
732
|
+
* **Details**
|
|
733
|
+
*
|
|
721
734
|
* This function always evaluates every element. If at least one effect fails,
|
|
722
735
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
723
736
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -761,6 +774,8 @@ export const validate: {
|
|
|
761
774
|
/**
|
|
762
775
|
* Applies an effectful function to each element and accumulates all failures.
|
|
763
776
|
*
|
|
777
|
+
* **Details**
|
|
778
|
+
*
|
|
764
779
|
* This function always evaluates every element. If at least one effect fails,
|
|
765
780
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
766
781
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -805,6 +820,8 @@ export const validate: {
|
|
|
805
820
|
/**
|
|
806
821
|
* Applies an effectful function to each element and accumulates all failures.
|
|
807
822
|
*
|
|
823
|
+
* **Details**
|
|
824
|
+
*
|
|
808
825
|
* This function always evaluates every element. If at least one effect fails,
|
|
809
826
|
* all failures are returned as a non-empty array and successes are discarded.
|
|
810
827
|
* If all effects succeed, it returns all collected successes.
|
|
@@ -851,6 +868,8 @@ export const validate: {
|
|
|
851
868
|
/**
|
|
852
869
|
* Returns the first element that satisfies an effectful predicate.
|
|
853
870
|
*
|
|
871
|
+
* **Details**
|
|
872
|
+
*
|
|
854
873
|
* The predicate receives the element and its index. Evaluation short-circuits
|
|
855
874
|
* as soon as an element matches.
|
|
856
875
|
*
|
|
@@ -872,6 +891,8 @@ export const findFirst: {
|
|
|
872
891
|
/**
|
|
873
892
|
* Returns the first element that satisfies an effectful predicate.
|
|
874
893
|
*
|
|
894
|
+
* **Details**
|
|
895
|
+
*
|
|
875
896
|
* The predicate receives the element and its index. Evaluation short-circuits
|
|
876
897
|
* as soon as an element matches.
|
|
877
898
|
*
|
|
@@ -893,6 +914,8 @@ export const findFirst: {
|
|
|
893
914
|
/**
|
|
894
915
|
* Returns the first element that satisfies an effectful predicate.
|
|
895
916
|
*
|
|
917
|
+
* **Details**
|
|
918
|
+
*
|
|
896
919
|
* The predicate receives the element and its index. Evaluation short-circuits
|
|
897
920
|
* as soon as an element matches.
|
|
898
921
|
*
|
|
@@ -919,6 +942,8 @@ export const findFirst: {
|
|
|
919
942
|
/**
|
|
920
943
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
921
944
|
*
|
|
945
|
+
* **Details**
|
|
946
|
+
*
|
|
922
947
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
923
948
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
924
949
|
*
|
|
@@ -929,6 +954,8 @@ export const findFirstFilter: {
|
|
|
929
954
|
/**
|
|
930
955
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
931
956
|
*
|
|
957
|
+
* **Details**
|
|
958
|
+
*
|
|
932
959
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
933
960
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
934
961
|
*
|
|
@@ -941,6 +968,8 @@ export const findFirstFilter: {
|
|
|
941
968
|
/**
|
|
942
969
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
943
970
|
*
|
|
971
|
+
* **Details**
|
|
972
|
+
*
|
|
944
973
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
945
974
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
946
975
|
*
|
|
@@ -964,18 +993,16 @@ export const findFirstFilter: {
|
|
|
964
993
|
* If any effect fails, the iteration stops immediately (short-circuiting), and
|
|
965
994
|
* the error is propagated.
|
|
966
995
|
*
|
|
967
|
-
*
|
|
996
|
+
* Concurrency:
|
|
968
997
|
*
|
|
969
998
|
* The `concurrency` option controls how many operations are performed
|
|
970
999
|
* concurrently. By default, the operations are performed sequentially.
|
|
971
1000
|
*
|
|
972
|
-
*
|
|
1001
|
+
* Discarding Results:
|
|
973
1002
|
*
|
|
974
1003
|
* If the `discard` option is set to `true`, the intermediate results are not
|
|
975
1004
|
* collected, and the final result of the operation is `void`.
|
|
976
1005
|
*
|
|
977
|
-
* @see {@link all} for combining multiple effects into one.
|
|
978
|
-
*
|
|
979
1006
|
* **Example** (Mapping over an iterable with effects)
|
|
980
1007
|
*
|
|
981
1008
|
* ```ts
|
|
@@ -1020,6 +1047,7 @@ export const findFirstFilter: {
|
|
|
1020
1047
|
* // undefined
|
|
1021
1048
|
* ```
|
|
1022
1049
|
*
|
|
1050
|
+
* @see {@link all} for combining multiple effects into one.
|
|
1023
1051
|
* @category Collecting
|
|
1024
1052
|
* @since 2.0.0
|
|
1025
1053
|
*/
|
|
@@ -1035,18 +1063,16 @@ export const forEach: {
|
|
|
1035
1063
|
* If any effect fails, the iteration stops immediately (short-circuiting), and
|
|
1036
1064
|
* the error is propagated.
|
|
1037
1065
|
*
|
|
1038
|
-
*
|
|
1066
|
+
* Concurrency:
|
|
1039
1067
|
*
|
|
1040
1068
|
* The `concurrency` option controls how many operations are performed
|
|
1041
1069
|
* concurrently. By default, the operations are performed sequentially.
|
|
1042
1070
|
*
|
|
1043
|
-
*
|
|
1071
|
+
* Discarding Results:
|
|
1044
1072
|
*
|
|
1045
1073
|
* If the `discard` option is set to `true`, the intermediate results are not
|
|
1046
1074
|
* collected, and the final result of the operation is `void`.
|
|
1047
1075
|
*
|
|
1048
|
-
* @see {@link all} for combining multiple effects into one.
|
|
1049
|
-
*
|
|
1050
1076
|
* **Example** (Mapping over an iterable with effects)
|
|
1051
1077
|
*
|
|
1052
1078
|
* ```ts
|
|
@@ -1091,6 +1117,7 @@ export const forEach: {
|
|
|
1091
1117
|
* // undefined
|
|
1092
1118
|
* ```
|
|
1093
1119
|
*
|
|
1120
|
+
* @see {@link all} for combining multiple effects into one.
|
|
1094
1121
|
* @category Collecting
|
|
1095
1122
|
* @since 2.0.0
|
|
1096
1123
|
*/
|
|
@@ -1109,18 +1136,16 @@ export const forEach: {
|
|
|
1109
1136
|
* If any effect fails, the iteration stops immediately (short-circuiting), and
|
|
1110
1137
|
* the error is propagated.
|
|
1111
1138
|
*
|
|
1112
|
-
*
|
|
1139
|
+
* Concurrency:
|
|
1113
1140
|
*
|
|
1114
1141
|
* The `concurrency` option controls how many operations are performed
|
|
1115
1142
|
* concurrently. By default, the operations are performed sequentially.
|
|
1116
1143
|
*
|
|
1117
|
-
*
|
|
1144
|
+
* Discarding Results:
|
|
1118
1145
|
*
|
|
1119
1146
|
* If the `discard` option is set to `true`, the intermediate results are not
|
|
1120
1147
|
* collected, and the final result of the operation is `void`.
|
|
1121
1148
|
*
|
|
1122
|
-
* @see {@link all} for combining multiple effects into one.
|
|
1123
|
-
*
|
|
1124
1149
|
* **Example** (Mapping over an iterable with effects)
|
|
1125
1150
|
*
|
|
1126
1151
|
* ```ts
|
|
@@ -1165,6 +1190,7 @@ export const forEach: {
|
|
|
1165
1190
|
* // undefined
|
|
1166
1191
|
* ```
|
|
1167
1192
|
*
|
|
1193
|
+
* @see {@link all} for combining multiple effects into one.
|
|
1168
1194
|
* @category Collecting
|
|
1169
1195
|
* @since 2.0.0
|
|
1170
1196
|
*/
|
|
@@ -1217,7 +1243,7 @@ export const whileLoop: <A, E, R>(options: {
|
|
|
1217
1243
|
* Creates an `Effect` that represents an asynchronous computation guaranteed to
|
|
1218
1244
|
* succeed.
|
|
1219
1245
|
*
|
|
1220
|
-
* **When to
|
|
1246
|
+
* **When to use**
|
|
1221
1247
|
*
|
|
1222
1248
|
* Use `promise` when you are sure the operation will not reject.
|
|
1223
1249
|
*
|
|
@@ -1231,13 +1257,11 @@ export const whileLoop: <A, E, R>(options: {
|
|
|
1231
1257
|
* crash in the program, which can be further managed or logged using tools like
|
|
1232
1258
|
* {@link catchDefect}.
|
|
1233
1259
|
*
|
|
1234
|
-
*
|
|
1260
|
+
* Interruptions:
|
|
1235
1261
|
*
|
|
1236
1262
|
* An optional `AbortSignal` can be provided to allow for interruption of the
|
|
1237
1263
|
* wrapped `Promise` API.
|
|
1238
1264
|
*
|
|
1239
|
-
* @see {@link tryPromise} for a version that can handle failures.
|
|
1240
|
-
*
|
|
1241
1265
|
* **Example** (Wrapping a non-rejecting Promise)
|
|
1242
1266
|
*
|
|
1243
1267
|
* ```ts
|
|
@@ -1258,6 +1282,7 @@ export const whileLoop: <A, E, R>(options: {
|
|
|
1258
1282
|
* const program = delay("Async operation completed successfully!")
|
|
1259
1283
|
* ```
|
|
1260
1284
|
*
|
|
1285
|
+
* @see {@link tryPromise} for a version that can handle failures.
|
|
1261
1286
|
* @category Creating Effects
|
|
1262
1287
|
* @since 2.0.0
|
|
1263
1288
|
*/
|
|
@@ -1269,7 +1294,7 @@ export const promise: <A>(
|
|
|
1269
1294
|
* Creates an `Effect` that represents an asynchronous computation that might
|
|
1270
1295
|
* fail.
|
|
1271
1296
|
*
|
|
1272
|
-
* **When to
|
|
1297
|
+
* **When to use**
|
|
1273
1298
|
*
|
|
1274
1299
|
* In situations where you need to perform asynchronous operations that might
|
|
1275
1300
|
* fail, such as fetching data from an API, you can use the `tryPromise`
|
|
@@ -1277,7 +1302,9 @@ export const promise: <A>(
|
|
|
1277
1302
|
* throw exceptions by capturing those exceptions and transforming them into
|
|
1278
1303
|
* manageable errors.
|
|
1279
1304
|
*
|
|
1280
|
-
* **
|
|
1305
|
+
* **Details**
|
|
1306
|
+
*
|
|
1307
|
+
* Error Handling:
|
|
1281
1308
|
*
|
|
1282
1309
|
* There are two ways to handle errors with `tryPromise`:
|
|
1283
1310
|
*
|
|
@@ -1286,7 +1313,7 @@ export const promise: <A>(
|
|
|
1286
1313
|
* 2. If you provide a `catch` function, the error is caught and the `catch`
|
|
1287
1314
|
* function maps it to an error of type `E`.
|
|
1288
1315
|
*
|
|
1289
|
-
*
|
|
1316
|
+
* Interruptions:
|
|
1290
1317
|
*
|
|
1291
1318
|
* An optional `AbortSignal` can be provided to allow for interruption of the
|
|
1292
1319
|
* wrapped `Promise` API.
|
|
@@ -1327,7 +1354,6 @@ export const promise: <A>(
|
|
|
1327
1354
|
* ```
|
|
1328
1355
|
*
|
|
1329
1356
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
1330
|
-
*
|
|
1331
1357
|
* @category Creating Effects
|
|
1332
1358
|
* @since 2.0.0
|
|
1333
1359
|
*/
|
|
@@ -1340,13 +1366,11 @@ export const tryPromise: <A, E = Cause.UnknownError>(
|
|
|
1340
1366
|
/**
|
|
1341
1367
|
* Creates an `Effect` that always succeeds with a given value.
|
|
1342
1368
|
*
|
|
1343
|
-
* **When to
|
|
1369
|
+
* **When to use**
|
|
1344
1370
|
*
|
|
1345
1371
|
* Use this function when you need an effect that completes successfully with a
|
|
1346
1372
|
* specific value without any errors or external dependencies.
|
|
1347
1373
|
*
|
|
1348
|
-
* @see {@link fail} to create an effect that represents a failure.
|
|
1349
|
-
*
|
|
1350
1374
|
* **Example** (Creating a successful effect)
|
|
1351
1375
|
*
|
|
1352
1376
|
* ```ts
|
|
@@ -1359,6 +1383,7 @@ export const tryPromise: <A, E = Cause.UnknownError>(
|
|
|
1359
1383
|
* const success = Effect.succeed(42)
|
|
1360
1384
|
* ```
|
|
1361
1385
|
*
|
|
1386
|
+
* @see {@link fail} to create an effect that represents a failure.
|
|
1362
1387
|
* @category Creating Effects
|
|
1363
1388
|
* @since 2.0.0
|
|
1364
1389
|
*/
|
|
@@ -1405,7 +1430,7 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
|
|
|
1405
1430
|
/**
|
|
1406
1431
|
* Delays the creation of an `Effect` until it is actually needed.
|
|
1407
1432
|
*
|
|
1408
|
-
* **When to
|
|
1433
|
+
* **When to use**
|
|
1409
1434
|
*
|
|
1410
1435
|
* Use `suspend` when you need to defer the evaluation of an effect until it is required. This is particularly useful for optimizing expensive computations, managing circular dependencies, or resolving type inference issues.
|
|
1411
1436
|
*
|
|
@@ -1495,7 +1520,7 @@ export const suspend: <A, E, R>(
|
|
|
1495
1520
|
/**
|
|
1496
1521
|
* Creates an `Effect` that represents a synchronous side-effectful computation.
|
|
1497
1522
|
*
|
|
1498
|
-
* **When to
|
|
1523
|
+
* **When to use**
|
|
1499
1524
|
*
|
|
1500
1525
|
* Use `sync` when you are sure the operation will not fail.
|
|
1501
1526
|
*
|
|
@@ -1509,8 +1534,6 @@ export const suspend: <A, E, R>(
|
|
|
1509
1534
|
* crash in the program, which can be further managed or logged using tools like
|
|
1510
1535
|
* {@link catchDefect}.
|
|
1511
1536
|
*
|
|
1512
|
-
* @see {@link try_ | try} for a version that can handle failures.
|
|
1513
|
-
*
|
|
1514
1537
|
* **Example** (Capturing synchronous logging in an Effect)
|
|
1515
1538
|
*
|
|
1516
1539
|
* ```ts
|
|
@@ -1526,6 +1549,7 @@ export const suspend: <A, E, R>(
|
|
|
1526
1549
|
* const program = log("Hello, World!")
|
|
1527
1550
|
* ```
|
|
1528
1551
|
*
|
|
1552
|
+
* @see {@link try_ | try} for a version that can handle failures.
|
|
1529
1553
|
* @category Creating Effects
|
|
1530
1554
|
* @since 2.0.0
|
|
1531
1555
|
*/
|
|
@@ -1534,6 +1558,8 @@ export const sync: <A>(thunk: LazyArg<A>) => Effect<A> = internal.sync
|
|
|
1534
1558
|
const void_: Effect<void> = internal.void
|
|
1535
1559
|
export {
|
|
1536
1560
|
/**
|
|
1561
|
+
* Returns an effect that succeeds with `void`.
|
|
1562
|
+
*
|
|
1537
1563
|
* @category Creating Effects
|
|
1538
1564
|
* @since 2.0.0
|
|
1539
1565
|
*/
|
|
@@ -1543,6 +1569,8 @@ export {
|
|
|
1543
1569
|
const undefined_: Effect<undefined> = internal.undefined
|
|
1544
1570
|
export {
|
|
1545
1571
|
/**
|
|
1572
|
+
* Returns an effect that succeeds with `undefined`.
|
|
1573
|
+
*
|
|
1546
1574
|
* @category Creating Effects
|
|
1547
1575
|
* @since 4.0.0
|
|
1548
1576
|
*/
|
|
@@ -1552,6 +1580,11 @@ export {
|
|
|
1552
1580
|
/**
|
|
1553
1581
|
* Creates an `Effect` from a callback-based asynchronous API.
|
|
1554
1582
|
*
|
|
1583
|
+
* **When to use**
|
|
1584
|
+
*
|
|
1585
|
+
* Use `Effect.callback` when integrating APIs that complete through callbacks
|
|
1586
|
+
* instead of returning a `Promise`.
|
|
1587
|
+
*
|
|
1555
1588
|
* **Details**
|
|
1556
1589
|
*
|
|
1557
1590
|
* The registration function receives a `resume` callback and, when requested,
|
|
@@ -1559,11 +1592,6 @@ export {
|
|
|
1559
1592
|
* complete the fiber; later calls are ignored. Return an optional cleanup
|
|
1560
1593
|
* effect from the registration function to run if the fiber is interrupted.
|
|
1561
1594
|
*
|
|
1562
|
-
* **When to Use**
|
|
1563
|
-
*
|
|
1564
|
-
* Use `Effect.callback` when integrating APIs that complete through callbacks
|
|
1565
|
-
* instead of returning a `Promise`.
|
|
1566
|
-
*
|
|
1567
1595
|
* **Example** (Integrating callback APIs)
|
|
1568
1596
|
*
|
|
1569
1597
|
* ```ts
|
|
@@ -1717,7 +1745,7 @@ export const bind: {
|
|
|
1717
1745
|
* Provides a way to write effectful code using generator functions, simplifying
|
|
1718
1746
|
* control flow and error handling.
|
|
1719
1747
|
*
|
|
1720
|
-
* **When to
|
|
1748
|
+
* **When to use**
|
|
1721
1749
|
*
|
|
1722
1750
|
* `gen` allows you to write code that looks and behaves like synchronous
|
|
1723
1751
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
@@ -1769,7 +1797,7 @@ export const gen: {
|
|
|
1769
1797
|
* Provides a way to write effectful code using generator functions, simplifying
|
|
1770
1798
|
* control flow and error handling.
|
|
1771
1799
|
*
|
|
1772
|
-
* **When to
|
|
1800
|
+
* **When to use**
|
|
1773
1801
|
*
|
|
1774
1802
|
* `gen` allows you to write code that looks and behaves like synchronous
|
|
1775
1803
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
@@ -1829,7 +1857,7 @@ export const gen: {
|
|
|
1829
1857
|
* Provides a way to write effectful code using generator functions, simplifying
|
|
1830
1858
|
* control flow and error handling.
|
|
1831
1859
|
*
|
|
1832
|
-
* **When to
|
|
1860
|
+
* **When to use**
|
|
1833
1861
|
*
|
|
1834
1862
|
* `gen` allows you to write code that looks and behaves like synchronous
|
|
1835
1863
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
@@ -1897,7 +1925,7 @@ export const gen: {
|
|
|
1897
1925
|
*
|
|
1898
1926
|
* @since 2.0.0
|
|
1899
1927
|
*/
|
|
1900
|
-
export namespace gen {
|
|
1928
|
+
export declare namespace gen {
|
|
1901
1929
|
/**
|
|
1902
1930
|
* Generator return type accepted by `Effect.gen`.
|
|
1903
1931
|
*
|
|
@@ -1910,14 +1938,12 @@ export namespace gen {
|
|
|
1910
1938
|
/**
|
|
1911
1939
|
* Creates an `Effect` that represents a recoverable error.
|
|
1912
1940
|
*
|
|
1913
|
-
* **When to
|
|
1941
|
+
* **When to use**
|
|
1914
1942
|
*
|
|
1915
1943
|
* Use this function to explicitly signal an error in an `Effect`. The error
|
|
1916
1944
|
* will keep propagating unless it is handled. You can handle the error with
|
|
1917
1945
|
* functions like {@link catchTag} or {@link catchTags}.
|
|
1918
1946
|
*
|
|
1919
|
-
* @see {@link succeed} to create an effect that represents a successful value.
|
|
1920
|
-
*
|
|
1921
1947
|
* **Example** (Creating a failed effect)
|
|
1922
1948
|
*
|
|
1923
1949
|
* ```ts
|
|
@@ -1932,6 +1958,7 @@ export namespace gen {
|
|
|
1932
1958
|
* )
|
|
1933
1959
|
* ```
|
|
1934
1960
|
*
|
|
1961
|
+
* @see {@link succeed} to create an effect that represents a successful value.
|
|
1935
1962
|
* @category Creating Effects
|
|
1936
1963
|
* @since 2.0.0
|
|
1937
1964
|
*/
|
|
@@ -1940,6 +1967,8 @@ export const fail: <E>(error: E) => Effect<never, E> = internal.fail
|
|
|
1940
1967
|
/**
|
|
1941
1968
|
* Creates an `Effect` that represents a recoverable error using a lazy evaluation.
|
|
1942
1969
|
*
|
|
1970
|
+
* **Details**
|
|
1971
|
+
*
|
|
1943
1972
|
* This function is useful when you need to create an error effect but want to
|
|
1944
1973
|
* defer the computation of the error value until the effect is actually run.
|
|
1945
1974
|
*
|
|
@@ -1964,6 +1993,8 @@ export const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E> = internal.
|
|
|
1964
1993
|
/**
|
|
1965
1994
|
* Creates an `Effect` that represents a failure with a specific `Cause`.
|
|
1966
1995
|
*
|
|
1996
|
+
* **Details**
|
|
1997
|
+
*
|
|
1967
1998
|
* This function allows you to create effects that fail with complex error
|
|
1968
1999
|
* structures, including multiple errors, defects, interruptions, and more.
|
|
1969
2000
|
*
|
|
@@ -1988,6 +2019,8 @@ export const failCause: <E>(cause: Cause.Cause<E>) => Effect<never, E> = interna
|
|
|
1988
2019
|
/**
|
|
1989
2020
|
* Creates an `Effect` that represents a failure with a `Cause` computed lazily.
|
|
1990
2021
|
*
|
|
2022
|
+
* **Details**
|
|
2023
|
+
*
|
|
1991
2024
|
* This function is useful when you need to create a failure effect with a
|
|
1992
2025
|
* complex cause but want to defer the computation until the effect is run.
|
|
1993
2026
|
*
|
|
@@ -2014,7 +2047,7 @@ export const failCauseSync: <E>(
|
|
|
2014
2047
|
/**
|
|
2015
2048
|
* Creates an effect that terminates a fiber with a specified error.
|
|
2016
2049
|
*
|
|
2017
|
-
* **When to
|
|
2050
|
+
* **When to use**
|
|
2018
2051
|
*
|
|
2019
2052
|
* Use `die` when encountering unexpected conditions in your code that should
|
|
2020
2053
|
* not be handled as regular errors but instead represent unrecoverable defects.
|
|
@@ -2028,8 +2061,6 @@ export const failCauseSync: <E>(
|
|
|
2028
2061
|
* The error channel of the resulting effect is of type `never`, indicating that
|
|
2029
2062
|
* it cannot recover from this failure.
|
|
2030
2063
|
*
|
|
2031
|
-
* @see {@link die} for a variant that dies with an already computed defect.
|
|
2032
|
-
*
|
|
2033
2064
|
* **Example** (Failing when division by zero)
|
|
2034
2065
|
*
|
|
2035
2066
|
* ```ts
|
|
@@ -2050,6 +2081,7 @@ export const failCauseSync: <E>(
|
|
|
2050
2081
|
* // ...stack trace...
|
|
2051
2082
|
* ```
|
|
2052
2083
|
*
|
|
2084
|
+
* @see {@link die} for a variant that dies with an already computed defect.
|
|
2053
2085
|
* @category Creating Effects
|
|
2054
2086
|
* @since 2.0.0
|
|
2055
2087
|
*/
|
|
@@ -2065,14 +2097,16 @@ export {
|
|
|
2065
2097
|
* Creates an `Effect` that represents a synchronous computation that might
|
|
2066
2098
|
* fail.
|
|
2067
2099
|
*
|
|
2068
|
-
* **When to
|
|
2100
|
+
* **When to use**
|
|
2069
2101
|
*
|
|
2070
2102
|
* In situations where you need to perform synchronous operations that might
|
|
2071
2103
|
* fail, such as parsing JSON, you can use the `try` constructor. This
|
|
2072
2104
|
* constructor is designed to handle operations that could throw exceptions by
|
|
2073
2105
|
* capturing those exceptions and transforming them into manageable errors.
|
|
2074
2106
|
*
|
|
2075
|
-
* **
|
|
2107
|
+
* **Details**
|
|
2108
|
+
*
|
|
2109
|
+
* Error Handling:
|
|
2076
2110
|
*
|
|
2077
2111
|
* There are two ways to handle errors with `try`:
|
|
2078
2112
|
*
|
|
@@ -2081,9 +2115,6 @@ export {
|
|
|
2081
2115
|
* 2. If you provide a `catch` function, the error is caught and the `catch`
|
|
2082
2116
|
* function maps it to an error of type `E`.
|
|
2083
2117
|
*
|
|
2084
|
-
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
2085
|
-
* throw errors.
|
|
2086
|
-
*
|
|
2087
2118
|
* **Example** (Parsing JSON with typed error mapping)
|
|
2088
2119
|
*
|
|
2089
2120
|
* ```ts
|
|
@@ -2121,6 +2152,8 @@ export {
|
|
|
2121
2152
|
* // Output: Exit.failure with custom Error message
|
|
2122
2153
|
* ```
|
|
2123
2154
|
*
|
|
2155
|
+
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
2156
|
+
* throw errors.
|
|
2124
2157
|
* @category Creating Effects
|
|
2125
2158
|
* @since 2.0.0
|
|
2126
2159
|
*/
|
|
@@ -2225,6 +2258,8 @@ export const fromResult: <A, E>(result: Result.Result<A, E>) => Effect<A, E> = i
|
|
|
2225
2258
|
/**
|
|
2226
2259
|
* Converts an `Option` into an `Effect`.
|
|
2227
2260
|
*
|
|
2261
|
+
* **Details**
|
|
2262
|
+
*
|
|
2228
2263
|
* `Option.some` becomes a successful effect with the contained value, while
|
|
2229
2264
|
* `Option.none` becomes a failed effect with `NoSuchElementError`.
|
|
2230
2265
|
*
|
|
@@ -2286,15 +2321,11 @@ export const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Cause.NoSuch
|
|
|
2286
2321
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
2287
2322
|
* operations that depend on previous results.
|
|
2288
2323
|
*
|
|
2289
|
-
* **
|
|
2324
|
+
* **When to use**
|
|
2290
2325
|
*
|
|
2291
|
-
*
|
|
2292
|
-
*
|
|
2293
|
-
*
|
|
2294
|
-
* const flatMappedEffect = Effect.flatMap(myEffect, transformation)
|
|
2295
|
-
* // or
|
|
2296
|
-
* const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))
|
|
2297
|
-
* ```
|
|
2326
|
+
* Use `flatMap` when you need to chain multiple effects, ensuring that each
|
|
2327
|
+
* step produces a new `Effect` while flattening any nested effects that may
|
|
2328
|
+
* occur.
|
|
2298
2329
|
*
|
|
2299
2330
|
* **Details**
|
|
2300
2331
|
*
|
|
@@ -2306,11 +2337,18 @@ export const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Cause.NoSuch
|
|
|
2306
2337
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2307
2338
|
* changing the original one.
|
|
2308
2339
|
*
|
|
2309
|
-
* **
|
|
2340
|
+
* **Example** (Syntax)
|
|
2310
2341
|
*
|
|
2311
|
-
*
|
|
2312
|
-
*
|
|
2313
|
-
*
|
|
2342
|
+
* ```ts
|
|
2343
|
+
* import { Effect, pipe } from "effect"
|
|
2344
|
+
*
|
|
2345
|
+
* const myEffect = Effect.succeed(1)
|
|
2346
|
+
* const transformation = (n: number) => Effect.succeed(n + 1)
|
|
2347
|
+
*
|
|
2348
|
+
* const flatMappedWithPipe = pipe(myEffect, Effect.flatMap(transformation))
|
|
2349
|
+
* const flatMappedWithDataFirst = Effect.flatMap(myEffect, transformation)
|
|
2350
|
+
* const flatMappedWithMethod = myEffect.pipe(Effect.flatMap(transformation))
|
|
2351
|
+
* ```
|
|
2314
2352
|
*
|
|
2315
2353
|
* **Example** (Sequencing dependent effects)
|
|
2316
2354
|
*
|
|
@@ -2342,7 +2380,6 @@ export const fromNullishOr: <A>(value: A) => Effect<NonNullable<A>, Cause.NoSuch
|
|
|
2342
2380
|
* ```
|
|
2343
2381
|
*
|
|
2344
2382
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2345
|
-
*
|
|
2346
2383
|
* @category sequencing
|
|
2347
2384
|
* @since 2.0.0
|
|
2348
2385
|
*/
|
|
@@ -2355,15 +2392,11 @@ export const flatMap: {
|
|
|
2355
2392
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
2356
2393
|
* operations that depend on previous results.
|
|
2357
2394
|
*
|
|
2358
|
-
* **
|
|
2395
|
+
* **When to use**
|
|
2359
2396
|
*
|
|
2360
|
-
*
|
|
2361
|
-
*
|
|
2362
|
-
*
|
|
2363
|
-
* const flatMappedEffect = Effect.flatMap(myEffect, transformation)
|
|
2364
|
-
* // or
|
|
2365
|
-
* const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))
|
|
2366
|
-
* ```
|
|
2397
|
+
* Use `flatMap` when you need to chain multiple effects, ensuring that each
|
|
2398
|
+
* step produces a new `Effect` while flattening any nested effects that may
|
|
2399
|
+
* occur.
|
|
2367
2400
|
*
|
|
2368
2401
|
* **Details**
|
|
2369
2402
|
*
|
|
@@ -2375,11 +2408,18 @@ export const flatMap: {
|
|
|
2375
2408
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2376
2409
|
* changing the original one.
|
|
2377
2410
|
*
|
|
2378
|
-
* **
|
|
2411
|
+
* **Example** (Syntax)
|
|
2379
2412
|
*
|
|
2380
|
-
*
|
|
2381
|
-
*
|
|
2382
|
-
*
|
|
2413
|
+
* ```ts
|
|
2414
|
+
* import { Effect, pipe } from "effect"
|
|
2415
|
+
*
|
|
2416
|
+
* const myEffect = Effect.succeed(1)
|
|
2417
|
+
* const transformation = (n: number) => Effect.succeed(n + 1)
|
|
2418
|
+
*
|
|
2419
|
+
* const flatMappedWithPipe = pipe(myEffect, Effect.flatMap(transformation))
|
|
2420
|
+
* const flatMappedWithDataFirst = Effect.flatMap(myEffect, transformation)
|
|
2421
|
+
* const flatMappedWithMethod = myEffect.pipe(Effect.flatMap(transformation))
|
|
2422
|
+
* ```
|
|
2383
2423
|
*
|
|
2384
2424
|
* **Example** (Sequencing dependent effects)
|
|
2385
2425
|
*
|
|
@@ -2411,7 +2451,6 @@ export const flatMap: {
|
|
|
2411
2451
|
* ```
|
|
2412
2452
|
*
|
|
2413
2453
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2414
|
-
*
|
|
2415
2454
|
* @category sequencing
|
|
2416
2455
|
* @since 2.0.0
|
|
2417
2456
|
*/
|
|
@@ -2424,15 +2463,11 @@ export const flatMap: {
|
|
|
2424
2463
|
* Chains effects to produce new `Effect` instances, useful for combining
|
|
2425
2464
|
* operations that depend on previous results.
|
|
2426
2465
|
*
|
|
2427
|
-
* **
|
|
2466
|
+
* **When to use**
|
|
2428
2467
|
*
|
|
2429
|
-
*
|
|
2430
|
-
*
|
|
2431
|
-
*
|
|
2432
|
-
* const flatMappedEffect = Effect.flatMap(myEffect, transformation)
|
|
2433
|
-
* // or
|
|
2434
|
-
* const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))
|
|
2435
|
-
* ```
|
|
2468
|
+
* Use `flatMap` when you need to chain multiple effects, ensuring that each
|
|
2469
|
+
* step produces a new `Effect` while flattening any nested effects that may
|
|
2470
|
+
* occur.
|
|
2436
2471
|
*
|
|
2437
2472
|
* **Details**
|
|
2438
2473
|
*
|
|
@@ -2444,11 +2479,18 @@ export const flatMap: {
|
|
|
2444
2479
|
* Since effects are immutable, `flatMap` always returns a new effect instead of
|
|
2445
2480
|
* changing the original one.
|
|
2446
2481
|
*
|
|
2447
|
-
* **
|
|
2482
|
+
* **Example** (Syntax)
|
|
2448
2483
|
*
|
|
2449
|
-
*
|
|
2450
|
-
*
|
|
2451
|
-
*
|
|
2484
|
+
* ```ts
|
|
2485
|
+
* import { Effect, pipe } from "effect"
|
|
2486
|
+
*
|
|
2487
|
+
* const myEffect = Effect.succeed(1)
|
|
2488
|
+
* const transformation = (n: number) => Effect.succeed(n + 1)
|
|
2489
|
+
*
|
|
2490
|
+
* const flatMappedWithPipe = pipe(myEffect, Effect.flatMap(transformation))
|
|
2491
|
+
* const flatMappedWithDataFirst = Effect.flatMap(myEffect, transformation)
|
|
2492
|
+
* const flatMappedWithMethod = myEffect.pipe(Effect.flatMap(transformation))
|
|
2493
|
+
* ```
|
|
2452
2494
|
*
|
|
2453
2495
|
* **Example** (Sequencing dependent effects)
|
|
2454
2496
|
*
|
|
@@ -2480,7 +2522,6 @@ export const flatMap: {
|
|
|
2480
2522
|
* ```
|
|
2481
2523
|
*
|
|
2482
2524
|
* @see {@link tap} for a version that ignores the result of the effect.
|
|
2483
|
-
*
|
|
2484
2525
|
* @category sequencing
|
|
2485
2526
|
* @since 2.0.0
|
|
2486
2527
|
*/
|
|
@@ -2514,17 +2555,7 @@ export const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2, R2>) =
|
|
|
2514
2555
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2515
2556
|
* effect's success value to choose the next effect.
|
|
2516
2557
|
*
|
|
2517
|
-
* **
|
|
2518
|
-
*
|
|
2519
|
-
* ```ts skip-type-checking
|
|
2520
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2521
|
-
* // or
|
|
2522
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2523
|
-
* // or
|
|
2524
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2525
|
-
* ```
|
|
2526
|
-
*
|
|
2527
|
-
* **When to Use**
|
|
2558
|
+
* **When to use**
|
|
2528
2559
|
*
|
|
2529
2560
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2530
2561
|
* may depend on the first effect's success value.
|
|
@@ -2539,6 +2570,19 @@ export const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2, R2>) =
|
|
|
2539
2570
|
* Failures or requirements from either effect are preserved in the returned
|
|
2540
2571
|
* effect.
|
|
2541
2572
|
*
|
|
2573
|
+
* **Example** (Syntax)
|
|
2574
|
+
*
|
|
2575
|
+
* ```ts
|
|
2576
|
+
* import { Effect, pipe } from "effect"
|
|
2577
|
+
*
|
|
2578
|
+
* const myEffect = Effect.succeed(1)
|
|
2579
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2580
|
+
*
|
|
2581
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2582
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2583
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2584
|
+
* ```
|
|
2585
|
+
*
|
|
2542
2586
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2543
2587
|
*
|
|
2544
2588
|
* ```ts
|
|
@@ -2587,17 +2631,7 @@ export const andThen: {
|
|
|
2587
2631
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2588
2632
|
* effect's success value to choose the next effect.
|
|
2589
2633
|
*
|
|
2590
|
-
* **
|
|
2591
|
-
*
|
|
2592
|
-
* ```ts skip-type-checking
|
|
2593
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2594
|
-
* // or
|
|
2595
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2596
|
-
* // or
|
|
2597
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2598
|
-
* ```
|
|
2599
|
-
*
|
|
2600
|
-
* **When to Use**
|
|
2634
|
+
* **When to use**
|
|
2601
2635
|
*
|
|
2602
2636
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2603
2637
|
* may depend on the first effect's success value.
|
|
@@ -2612,6 +2646,19 @@ export const andThen: {
|
|
|
2612
2646
|
* Failures or requirements from either effect are preserved in the returned
|
|
2613
2647
|
* effect.
|
|
2614
2648
|
*
|
|
2649
|
+
* **Example** (Syntax)
|
|
2650
|
+
*
|
|
2651
|
+
* ```ts
|
|
2652
|
+
* import { Effect, pipe } from "effect"
|
|
2653
|
+
*
|
|
2654
|
+
* const myEffect = Effect.succeed(1)
|
|
2655
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2656
|
+
*
|
|
2657
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2658
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2659
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2660
|
+
* ```
|
|
2661
|
+
*
|
|
2615
2662
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2616
2663
|
*
|
|
2617
2664
|
* ```ts
|
|
@@ -2660,17 +2707,7 @@ export const andThen: {
|
|
|
2660
2707
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2661
2708
|
* effect's success value to choose the next effect.
|
|
2662
2709
|
*
|
|
2663
|
-
* **
|
|
2664
|
-
*
|
|
2665
|
-
* ```ts skip-type-checking
|
|
2666
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2667
|
-
* // or
|
|
2668
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2669
|
-
* // or
|
|
2670
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2671
|
-
* ```
|
|
2672
|
-
*
|
|
2673
|
-
* **When to Use**
|
|
2710
|
+
* **When to use**
|
|
2674
2711
|
*
|
|
2675
2712
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2676
2713
|
* may depend on the first effect's success value.
|
|
@@ -2685,6 +2722,19 @@ export const andThen: {
|
|
|
2685
2722
|
* Failures or requirements from either effect are preserved in the returned
|
|
2686
2723
|
* effect.
|
|
2687
2724
|
*
|
|
2725
|
+
* **Example** (Syntax)
|
|
2726
|
+
*
|
|
2727
|
+
* ```ts
|
|
2728
|
+
* import { Effect, pipe } from "effect"
|
|
2729
|
+
*
|
|
2730
|
+
* const myEffect = Effect.succeed(1)
|
|
2731
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2732
|
+
*
|
|
2733
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2734
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2735
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2736
|
+
* ```
|
|
2737
|
+
*
|
|
2688
2738
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2689
2739
|
*
|
|
2690
2740
|
* ```ts
|
|
@@ -2733,17 +2783,7 @@ export const andThen: {
|
|
|
2733
2783
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2734
2784
|
* effect's success value to choose the next effect.
|
|
2735
2785
|
*
|
|
2736
|
-
* **
|
|
2737
|
-
*
|
|
2738
|
-
* ```ts skip-type-checking
|
|
2739
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2740
|
-
* // or
|
|
2741
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2742
|
-
* // or
|
|
2743
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2744
|
-
* ```
|
|
2745
|
-
*
|
|
2746
|
-
* **When to Use**
|
|
2786
|
+
* **When to use**
|
|
2747
2787
|
*
|
|
2748
2788
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2749
2789
|
* may depend on the first effect's success value.
|
|
@@ -2758,6 +2798,19 @@ export const andThen: {
|
|
|
2758
2798
|
* Failures or requirements from either effect are preserved in the returned
|
|
2759
2799
|
* effect.
|
|
2760
2800
|
*
|
|
2801
|
+
* **Example** (Syntax)
|
|
2802
|
+
*
|
|
2803
|
+
* ```ts
|
|
2804
|
+
* import { Effect, pipe } from "effect"
|
|
2805
|
+
*
|
|
2806
|
+
* const myEffect = Effect.succeed(1)
|
|
2807
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2808
|
+
*
|
|
2809
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2810
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2811
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2812
|
+
* ```
|
|
2813
|
+
*
|
|
2761
2814
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2762
2815
|
*
|
|
2763
2816
|
* ```ts
|
|
@@ -2806,17 +2859,7 @@ export const andThen: {
|
|
|
2806
2859
|
* Runs this effect and then runs another effect, optionally using the first
|
|
2807
2860
|
* effect's success value to choose the next effect.
|
|
2808
2861
|
*
|
|
2809
|
-
* **
|
|
2810
|
-
*
|
|
2811
|
-
* ```ts skip-type-checking
|
|
2812
|
-
* const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2813
|
-
* // or
|
|
2814
|
-
* const transformedEffect = Effect.andThen(myEffect, anotherEffect)
|
|
2815
|
-
* // or
|
|
2816
|
-
* const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2817
|
-
* ```
|
|
2818
|
-
*
|
|
2819
|
-
* **When to Use**
|
|
2862
|
+
* **When to use**
|
|
2820
2863
|
*
|
|
2821
2864
|
* Use `andThen` when one effect must run after another and the second effect
|
|
2822
2865
|
* may depend on the first effect's success value.
|
|
@@ -2831,6 +2874,19 @@ export const andThen: {
|
|
|
2831
2874
|
* Failures or requirements from either effect are preserved in the returned
|
|
2832
2875
|
* effect.
|
|
2833
2876
|
*
|
|
2877
|
+
* **Example** (Syntax)
|
|
2878
|
+
*
|
|
2879
|
+
* ```ts
|
|
2880
|
+
* import { Effect, pipe } from "effect"
|
|
2881
|
+
*
|
|
2882
|
+
* const myEffect = Effect.succeed(1)
|
|
2883
|
+
* const anotherEffect = Effect.succeed("done")
|
|
2884
|
+
*
|
|
2885
|
+
* const transformedWithPipe = pipe(myEffect, Effect.andThen(anotherEffect))
|
|
2886
|
+
* const transformedWithDataFirst = Effect.andThen(myEffect, anotherEffect)
|
|
2887
|
+
* const transformedWithMethod = myEffect.pipe(Effect.andThen(anotherEffect))
|
|
2888
|
+
* ```
|
|
2889
|
+
*
|
|
2834
2890
|
* **Example** (Sequencing a discount calculation after fetching a total)
|
|
2835
2891
|
*
|
|
2836
2892
|
* ```ts
|
|
@@ -2881,7 +2937,7 @@ export const andThen: {
|
|
|
2881
2937
|
* Runs a side effect with the result of an effect without changing the original
|
|
2882
2938
|
* value.
|
|
2883
2939
|
*
|
|
2884
|
-
* **When to
|
|
2940
|
+
* **When to use**
|
|
2885
2941
|
*
|
|
2886
2942
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2887
2943
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -2935,7 +2991,7 @@ export const tap: {
|
|
|
2935
2991
|
* Runs a side effect with the result of an effect without changing the original
|
|
2936
2992
|
* value.
|
|
2937
2993
|
*
|
|
2938
|
-
* **When to
|
|
2994
|
+
* **When to use**
|
|
2939
2995
|
*
|
|
2940
2996
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2941
2997
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -2989,7 +3045,7 @@ export const tap: {
|
|
|
2989
3045
|
* Runs a side effect with the result of an effect without changing the original
|
|
2990
3046
|
* value.
|
|
2991
3047
|
*
|
|
2992
|
-
* **When to
|
|
3048
|
+
* **When to use**
|
|
2993
3049
|
*
|
|
2994
3050
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
2995
3051
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -3043,7 +3099,7 @@ export const tap: {
|
|
|
3043
3099
|
* Runs a side effect with the result of an effect without changing the original
|
|
3044
3100
|
* value.
|
|
3045
3101
|
*
|
|
3046
|
-
* **When to
|
|
3102
|
+
* **When to use**
|
|
3047
3103
|
*
|
|
3048
3104
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
3049
3105
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -3097,7 +3153,7 @@ export const tap: {
|
|
|
3097
3153
|
* Runs a side effect with the result of an effect without changing the original
|
|
3098
3154
|
* value.
|
|
3099
3155
|
*
|
|
3100
|
-
* **When to
|
|
3156
|
+
* **When to use**
|
|
3101
3157
|
*
|
|
3102
3158
|
* Use `tap` when you want to perform a side effect, like logging or tracking,
|
|
3103
3159
|
* without modifying the main value. This is useful when you need to observe or
|
|
@@ -3276,16 +3332,6 @@ export const exit: <A, E, R>(
|
|
|
3276
3332
|
/**
|
|
3277
3333
|
* Transforms the value inside an effect by applying a function to it.
|
|
3278
3334
|
*
|
|
3279
|
-
* **Syntax**
|
|
3280
|
-
*
|
|
3281
|
-
* ```ts skip-type-checking
|
|
3282
|
-
* const mappedEffect = pipe(myEffect, Effect.map(transformation))
|
|
3283
|
-
* // or
|
|
3284
|
-
* const mappedEffect = Effect.map(myEffect, transformation)
|
|
3285
|
-
* // or
|
|
3286
|
-
* const mappedEffect = myEffect.pipe(Effect.map(transformation))
|
|
3287
|
-
* ```
|
|
3288
|
-
*
|
|
3289
3335
|
* **Details**
|
|
3290
3336
|
*
|
|
3291
3337
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -3295,6 +3341,19 @@ export const exit: <A, E, R>(
|
|
|
3295
3341
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3296
3342
|
* value.
|
|
3297
3343
|
*
|
|
3344
|
+
* **Example** (Syntax)
|
|
3345
|
+
*
|
|
3346
|
+
* ```ts
|
|
3347
|
+
* import { Effect, pipe } from "effect"
|
|
3348
|
+
*
|
|
3349
|
+
* const myEffect = Effect.succeed(1)
|
|
3350
|
+
* const transformation = (n: number) => n + 1
|
|
3351
|
+
*
|
|
3352
|
+
* const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
|
|
3353
|
+
* const mappedWithDataFirst = Effect.map(myEffect, transformation)
|
|
3354
|
+
* const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
|
|
3355
|
+
* ```
|
|
3356
|
+
*
|
|
3298
3357
|
* **Example** (Adding a service charge)
|
|
3299
3358
|
*
|
|
3300
3359
|
* ```ts
|
|
@@ -3316,7 +3375,6 @@ export const exit: <A, E, R>(
|
|
|
3316
3375
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3317
3376
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3318
3377
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3319
|
-
*
|
|
3320
3378
|
* @category mapping
|
|
3321
3379
|
* @since 2.0.0
|
|
3322
3380
|
*/
|
|
@@ -3324,16 +3382,6 @@ export const map: {
|
|
|
3324
3382
|
/**
|
|
3325
3383
|
* Transforms the value inside an effect by applying a function to it.
|
|
3326
3384
|
*
|
|
3327
|
-
* **Syntax**
|
|
3328
|
-
*
|
|
3329
|
-
* ```ts skip-type-checking
|
|
3330
|
-
* const mappedEffect = pipe(myEffect, Effect.map(transformation))
|
|
3331
|
-
* // or
|
|
3332
|
-
* const mappedEffect = Effect.map(myEffect, transformation)
|
|
3333
|
-
* // or
|
|
3334
|
-
* const mappedEffect = myEffect.pipe(Effect.map(transformation))
|
|
3335
|
-
* ```
|
|
3336
|
-
*
|
|
3337
3385
|
* **Details**
|
|
3338
3386
|
*
|
|
3339
3387
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -3343,6 +3391,19 @@ export const map: {
|
|
|
3343
3391
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3344
3392
|
* value.
|
|
3345
3393
|
*
|
|
3394
|
+
* **Example** (Syntax)
|
|
3395
|
+
*
|
|
3396
|
+
* ```ts
|
|
3397
|
+
* import { Effect, pipe } from "effect"
|
|
3398
|
+
*
|
|
3399
|
+
* const myEffect = Effect.succeed(1)
|
|
3400
|
+
* const transformation = (n: number) => n + 1
|
|
3401
|
+
*
|
|
3402
|
+
* const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
|
|
3403
|
+
* const mappedWithDataFirst = Effect.map(myEffect, transformation)
|
|
3404
|
+
* const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
|
|
3405
|
+
* ```
|
|
3406
|
+
*
|
|
3346
3407
|
* **Example** (Adding a service charge)
|
|
3347
3408
|
*
|
|
3348
3409
|
* ```ts
|
|
@@ -3364,7 +3425,6 @@ export const map: {
|
|
|
3364
3425
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3365
3426
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3366
3427
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3367
|
-
*
|
|
3368
3428
|
* @category mapping
|
|
3369
3429
|
* @since 2.0.0
|
|
3370
3430
|
*/
|
|
@@ -3372,16 +3432,6 @@ export const map: {
|
|
|
3372
3432
|
/**
|
|
3373
3433
|
* Transforms the value inside an effect by applying a function to it.
|
|
3374
3434
|
*
|
|
3375
|
-
* **Syntax**
|
|
3376
|
-
*
|
|
3377
|
-
* ```ts skip-type-checking
|
|
3378
|
-
* const mappedEffect = pipe(myEffect, Effect.map(transformation))
|
|
3379
|
-
* // or
|
|
3380
|
-
* const mappedEffect = Effect.map(myEffect, transformation)
|
|
3381
|
-
* // or
|
|
3382
|
-
* const mappedEffect = myEffect.pipe(Effect.map(transformation))
|
|
3383
|
-
* ```
|
|
3384
|
-
*
|
|
3385
3435
|
* **Details**
|
|
3386
3436
|
*
|
|
3387
3437
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -3391,6 +3441,19 @@ export const map: {
|
|
|
3391
3441
|
* effect is not modified. Instead, a new effect is returned with the updated
|
|
3392
3442
|
* value.
|
|
3393
3443
|
*
|
|
3444
|
+
* **Example** (Syntax)
|
|
3445
|
+
*
|
|
3446
|
+
* ```ts
|
|
3447
|
+
* import { Effect, pipe } from "effect"
|
|
3448
|
+
*
|
|
3449
|
+
* const myEffect = Effect.succeed(1)
|
|
3450
|
+
* const transformation = (n: number) => n + 1
|
|
3451
|
+
*
|
|
3452
|
+
* const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
|
|
3453
|
+
* const mappedWithDataFirst = Effect.map(myEffect, transformation)
|
|
3454
|
+
* const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
|
|
3455
|
+
* ```
|
|
3456
|
+
*
|
|
3394
3457
|
* **Example** (Adding a service charge)
|
|
3395
3458
|
*
|
|
3396
3459
|
* ```ts
|
|
@@ -3412,7 +3475,6 @@ export const map: {
|
|
|
3412
3475
|
* @see {@link mapError} for a version that operates on the error channel.
|
|
3413
3476
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
3414
3477
|
* @see {@link flatMap} or {@link andThen} for a version that can return a new effect.
|
|
3415
|
-
*
|
|
3416
3478
|
* @category mapping
|
|
3417
3479
|
* @since 2.0.0
|
|
3418
3480
|
*/
|
|
@@ -3422,6 +3484,8 @@ export const map: {
|
|
|
3422
3484
|
/**
|
|
3423
3485
|
* Replaces the value inside an effect with a constant value.
|
|
3424
3486
|
*
|
|
3487
|
+
* **Details**
|
|
3488
|
+
*
|
|
3425
3489
|
* `as` allows you to ignore the original value inside an effect and
|
|
3426
3490
|
* replace it with a new constant value.
|
|
3427
3491
|
*
|
|
@@ -3444,6 +3508,8 @@ export const as: {
|
|
|
3444
3508
|
/**
|
|
3445
3509
|
* Replaces the value inside an effect with a constant value.
|
|
3446
3510
|
*
|
|
3511
|
+
* **Details**
|
|
3512
|
+
*
|
|
3447
3513
|
* `as` allows you to ignore the original value inside an effect and
|
|
3448
3514
|
* replace it with a new constant value.
|
|
3449
3515
|
*
|
|
@@ -3466,6 +3532,8 @@ export const as: {
|
|
|
3466
3532
|
/**
|
|
3467
3533
|
* Replaces the value inside an effect with a constant value.
|
|
3468
3534
|
*
|
|
3535
|
+
* **Details**
|
|
3536
|
+
*
|
|
3469
3537
|
* `as` allows you to ignore the original value inside an effect and
|
|
3470
3538
|
* replace it with a new constant value.
|
|
3471
3539
|
*
|
|
@@ -3534,6 +3602,8 @@ export const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E, R> = in
|
|
|
3534
3602
|
* The `flip` function swaps the success and error channels of an effect,
|
|
3535
3603
|
* so that the success becomes the error, and the error becomes the success.
|
|
3536
3604
|
*
|
|
3605
|
+
* **Details**
|
|
3606
|
+
*
|
|
3537
3607
|
* This function is useful when you need to reverse the flow of an effect,
|
|
3538
3608
|
* treating the previously successful values as errors and vice versa. This can
|
|
3539
3609
|
* be helpful in scenarios where you want to handle a success as a failure or
|
|
@@ -3565,17 +3635,16 @@ export const flip: <A, E, R>(self: Effect<A, E, R>) => Effect<E, A, R> = interna
|
|
|
3565
3635
|
/**
|
|
3566
3636
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
3567
3637
|
*
|
|
3638
|
+
* **Details**
|
|
3639
|
+
*
|
|
3568
3640
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
3569
3641
|
* Once both effects succeed, their results are combined into a tuple.
|
|
3570
3642
|
*
|
|
3571
|
-
*
|
|
3643
|
+
* Concurrency:
|
|
3572
3644
|
*
|
|
3573
3645
|
* By default, `zip` processes the effects sequentially. To execute the effects concurrently,
|
|
3574
3646
|
* use the `{ concurrent: true }` option.
|
|
3575
3647
|
*
|
|
3576
|
-
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3577
|
-
* @see {@link validate} for a version that accumulates errors.
|
|
3578
|
-
*
|
|
3579
3648
|
* **Example** (Combining two effects sequentially)
|
|
3580
3649
|
*
|
|
3581
3650
|
* ```ts
|
|
@@ -3627,6 +3696,8 @@ export const flip: <A, E, R>(self: Effect<A, E, R>) => Effect<E, A, R> = interna
|
|
|
3627
3696
|
* // [ 1, 'hello' ]
|
|
3628
3697
|
* ```
|
|
3629
3698
|
*
|
|
3699
|
+
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3700
|
+
* @see {@link validate} for a version that accumulates errors.
|
|
3630
3701
|
* @category zipping
|
|
3631
3702
|
* @since 2.0.0
|
|
3632
3703
|
*/
|
|
@@ -3638,17 +3709,16 @@ export const zip: {
|
|
|
3638
3709
|
/**
|
|
3639
3710
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
3640
3711
|
*
|
|
3712
|
+
* **Details**
|
|
3713
|
+
*
|
|
3641
3714
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
3642
3715
|
* Once both effects succeed, their results are combined into a tuple.
|
|
3643
3716
|
*
|
|
3644
|
-
*
|
|
3717
|
+
* Concurrency:
|
|
3645
3718
|
*
|
|
3646
3719
|
* By default, `zip` processes the effects sequentially. To execute the effects concurrently,
|
|
3647
3720
|
* use the `{ concurrent: true }` option.
|
|
3648
3721
|
*
|
|
3649
|
-
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3650
|
-
* @see {@link validate} for a version that accumulates errors.
|
|
3651
|
-
*
|
|
3652
3722
|
* **Example** (Combining two effects sequentially)
|
|
3653
3723
|
*
|
|
3654
3724
|
* ```ts
|
|
@@ -3700,6 +3770,8 @@ export const zip: {
|
|
|
3700
3770
|
* // [ 1, 'hello' ]
|
|
3701
3771
|
* ```
|
|
3702
3772
|
*
|
|
3773
|
+
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3774
|
+
* @see {@link validate} for a version that accumulates errors.
|
|
3703
3775
|
* @category zipping
|
|
3704
3776
|
* @since 2.0.0
|
|
3705
3777
|
*/
|
|
@@ -3714,17 +3786,16 @@ export const zip: {
|
|
|
3714
3786
|
/**
|
|
3715
3787
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
3716
3788
|
*
|
|
3789
|
+
* **Details**
|
|
3790
|
+
*
|
|
3717
3791
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
3718
3792
|
* Once both effects succeed, their results are combined into a tuple.
|
|
3719
3793
|
*
|
|
3720
|
-
*
|
|
3794
|
+
* Concurrency:
|
|
3721
3795
|
*
|
|
3722
3796
|
* By default, `zip` processes the effects sequentially. To execute the effects concurrently,
|
|
3723
3797
|
* use the `{ concurrent: true }` option.
|
|
3724
3798
|
*
|
|
3725
|
-
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3726
|
-
* @see {@link validate} for a version that accumulates errors.
|
|
3727
|
-
*
|
|
3728
3799
|
* **Example** (Combining two effects sequentially)
|
|
3729
3800
|
*
|
|
3730
3801
|
* ```ts
|
|
@@ -3776,6 +3847,8 @@ export const zip: {
|
|
|
3776
3847
|
* // [ 1, 'hello' ]
|
|
3777
3848
|
* ```
|
|
3778
3849
|
*
|
|
3850
|
+
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
3851
|
+
* @see {@link validate} for a version that accumulates errors.
|
|
3779
3852
|
* @category zipping
|
|
3780
3853
|
* @since 2.0.0
|
|
3781
3854
|
*/
|
|
@@ -3790,13 +3863,15 @@ export const zip: {
|
|
|
3790
3863
|
* Combines two effects sequentially and applies a function to their results to
|
|
3791
3864
|
* produce a single value.
|
|
3792
3865
|
*
|
|
3793
|
-
* **When to
|
|
3866
|
+
* **When to use**
|
|
3794
3867
|
*
|
|
3795
3868
|
* The `zipWith` function is similar to {@link zip}, but instead of returning a
|
|
3796
3869
|
* tuple of results, it applies a provided function to the results of the two
|
|
3797
3870
|
* effects, combining them into a single value.
|
|
3798
3871
|
*
|
|
3799
|
-
* **
|
|
3872
|
+
* **Details**
|
|
3873
|
+
*
|
|
3874
|
+
* Concurrency:
|
|
3800
3875
|
*
|
|
3801
3876
|
* By default, the effects are run sequentially. To execute them concurrently,
|
|
3802
3877
|
* use the `{ concurrent: true }` option.
|
|
@@ -3837,13 +3912,15 @@ export const zipWith: {
|
|
|
3837
3912
|
* Combines two effects sequentially and applies a function to their results to
|
|
3838
3913
|
* produce a single value.
|
|
3839
3914
|
*
|
|
3840
|
-
* **When to
|
|
3915
|
+
* **When to use**
|
|
3841
3916
|
*
|
|
3842
3917
|
* The `zipWith` function is similar to {@link zip}, but instead of returning a
|
|
3843
3918
|
* tuple of results, it applies a provided function to the results of the two
|
|
3844
3919
|
* effects, combining them into a single value.
|
|
3845
3920
|
*
|
|
3846
|
-
* **
|
|
3921
|
+
* **Details**
|
|
3922
|
+
*
|
|
3923
|
+
* Concurrency:
|
|
3847
3924
|
*
|
|
3848
3925
|
* By default, the effects are run sequentially. To execute them concurrently,
|
|
3849
3926
|
* use the `{ concurrent: true }` option.
|
|
@@ -3888,13 +3965,15 @@ export const zipWith: {
|
|
|
3888
3965
|
* Combines two effects sequentially and applies a function to their results to
|
|
3889
3966
|
* produce a single value.
|
|
3890
3967
|
*
|
|
3891
|
-
* **When to
|
|
3968
|
+
* **When to use**
|
|
3892
3969
|
*
|
|
3893
3970
|
* The `zipWith` function is similar to {@link zip}, but instead of returning a
|
|
3894
3971
|
* tuple of results, it applies a provided function to the results of the two
|
|
3895
3972
|
* effects, combining them into a single value.
|
|
3896
3973
|
*
|
|
3897
|
-
* **
|
|
3974
|
+
* **Details**
|
|
3975
|
+
*
|
|
3976
|
+
* Concurrency:
|
|
3898
3977
|
*
|
|
3899
3978
|
* By default, the effects are run sequentially. To execute them concurrently,
|
|
3900
3979
|
* use the `{ concurrent: true }` option.
|
|
@@ -3978,7 +4057,7 @@ export {
|
|
|
3978
4057
|
* Catches and handles specific errors by their `_tag` field, which is used as a
|
|
3979
4058
|
* discriminator.
|
|
3980
4059
|
*
|
|
3981
|
-
* **When to
|
|
4060
|
+
* **When to use**
|
|
3982
4061
|
*
|
|
3983
4062
|
* `catchTag` is useful when your errors are tagged with a readonly `_tag` field
|
|
3984
4063
|
* that identifies the error type. You can use this function to handle specific
|
|
@@ -4020,7 +4099,7 @@ export const catchTag: {
|
|
|
4020
4099
|
* Catches and handles specific errors by their `_tag` field, which is used as a
|
|
4021
4100
|
* discriminator.
|
|
4022
4101
|
*
|
|
4023
|
-
* **When to
|
|
4102
|
+
* **When to use**
|
|
4024
4103
|
*
|
|
4025
4104
|
* `catchTag` is useful when your errors are tagged with a readonly `_tag` field
|
|
4026
4105
|
* that identifies the error type. You can use this function to handle specific
|
|
@@ -4077,7 +4156,7 @@ export const catchTag: {
|
|
|
4077
4156
|
* Catches and handles specific errors by their `_tag` field, which is used as a
|
|
4078
4157
|
* discriminator.
|
|
4079
4158
|
*
|
|
4080
|
-
* **When to
|
|
4159
|
+
* **When to use**
|
|
4081
4160
|
*
|
|
4082
4161
|
* `catchTag` is useful when your errors are tagged with a readonly `_tag` field
|
|
4083
4162
|
* that identifies the error type. You can use this function to handle specific
|
|
@@ -4138,7 +4217,7 @@ export const catchTag: {
|
|
|
4138
4217
|
/**
|
|
4139
4218
|
* Handles multiple errors in a single block of code using their `_tag` field.
|
|
4140
4219
|
*
|
|
4141
|
-
* **When to
|
|
4220
|
+
* **When to use**
|
|
4142
4221
|
*
|
|
4143
4222
|
* `catchTags` is a convenient way to handle multiple error types at
|
|
4144
4223
|
* once. Instead of using {@link catchTag} multiple times, you can pass an
|
|
@@ -4182,7 +4261,7 @@ export const catchTags: {
|
|
|
4182
4261
|
/**
|
|
4183
4262
|
* Handles multiple errors in a single block of code using their `_tag` field.
|
|
4184
4263
|
*
|
|
4185
|
-
* **When to
|
|
4264
|
+
* **When to use**
|
|
4186
4265
|
*
|
|
4187
4266
|
* `catchTags` is a convenient way to handle multiple error types at
|
|
4188
4267
|
* once. Instead of using {@link catchTag} multiple times, you can pass an
|
|
@@ -4254,7 +4333,7 @@ export const catchTags: {
|
|
|
4254
4333
|
/**
|
|
4255
4334
|
* Handles multiple errors in a single block of code using their `_tag` field.
|
|
4256
4335
|
*
|
|
4257
|
-
* **When to
|
|
4336
|
+
* **When to use**
|
|
4258
4337
|
*
|
|
4259
4338
|
* `catchTags` is a convenient way to handle multiple error types at
|
|
4260
4339
|
* once. Instead of using {@link catchTag} multiple times, you can pass an
|
|
@@ -4329,6 +4408,8 @@ export const catchTags: {
|
|
|
4329
4408
|
/**
|
|
4330
4409
|
* Catches a specific reason within a tagged error.
|
|
4331
4410
|
*
|
|
4411
|
+
* **Details**
|
|
4412
|
+
*
|
|
4332
4413
|
* Use this to handle nested error causes without removing the parent error
|
|
4333
4414
|
* from the error channel. The handler receives the unwrapped reason.
|
|
4334
4415
|
*
|
|
@@ -4366,6 +4447,8 @@ export const catchReason: {
|
|
|
4366
4447
|
/**
|
|
4367
4448
|
* Catches a specific reason within a tagged error.
|
|
4368
4449
|
*
|
|
4450
|
+
* **Details**
|
|
4451
|
+
*
|
|
4369
4452
|
* Use this to handle nested error causes without removing the parent error
|
|
4370
4453
|
* from the error channel. The handler receives the unwrapped reason.
|
|
4371
4454
|
*
|
|
@@ -4428,6 +4511,8 @@ export const catchReason: {
|
|
|
4428
4511
|
/**
|
|
4429
4512
|
* Catches a specific reason within a tagged error.
|
|
4430
4513
|
*
|
|
4514
|
+
* **Details**
|
|
4515
|
+
*
|
|
4431
4516
|
* Use this to handle nested error causes without removing the parent error
|
|
4432
4517
|
* from the error channel. The handler receives the unwrapped reason.
|
|
4433
4518
|
*
|
|
@@ -4676,6 +4761,8 @@ export const catchReasons: {
|
|
|
4676
4761
|
/**
|
|
4677
4762
|
* Type helper that keeps only error tags whose tagged error contains a tagged `reason` field.
|
|
4678
4763
|
*
|
|
4764
|
+
* **Details**
|
|
4765
|
+
*
|
|
4679
4766
|
* Used by `catchReasons` and `unwrapReason` to constrain the parent error tag to reason-bearing errors.
|
|
4680
4767
|
*
|
|
4681
4768
|
* @category error handling
|
|
@@ -4795,14 +4882,16 @@ export const unwrapReason: {
|
|
|
4795
4882
|
* Handles both recoverable and unrecoverable errors by providing a recovery
|
|
4796
4883
|
* effect.
|
|
4797
4884
|
*
|
|
4798
|
-
* **When to
|
|
4885
|
+
* **When to use**
|
|
4799
4886
|
*
|
|
4800
4887
|
* The `catchCause` function allows you to handle all errors, including
|
|
4801
4888
|
* unrecoverable defects, by providing a recovery effect. The recovery logic is
|
|
4802
4889
|
* based on the `Cause` of the error, which provides detailed information about
|
|
4803
4890
|
* the failure.
|
|
4804
4891
|
*
|
|
4805
|
-
* **
|
|
4892
|
+
* **Details**
|
|
4893
|
+
*
|
|
4894
|
+
* When to Recover from Defects:
|
|
4806
4895
|
*
|
|
4807
4896
|
* Defects are unexpected errors that typically shouldn't be recovered from, as
|
|
4808
4897
|
* they often indicate serious issues. However, in some cases, such as
|
|
@@ -4835,14 +4924,16 @@ export const catchCause: {
|
|
|
4835
4924
|
* Handles both recoverable and unrecoverable errors by providing a recovery
|
|
4836
4925
|
* effect.
|
|
4837
4926
|
*
|
|
4838
|
-
* **When to
|
|
4927
|
+
* **When to use**
|
|
4839
4928
|
*
|
|
4840
4929
|
* The `catchCause` function allows you to handle all errors, including
|
|
4841
4930
|
* unrecoverable defects, by providing a recovery effect. The recovery logic is
|
|
4842
4931
|
* based on the `Cause` of the error, which provides detailed information about
|
|
4843
4932
|
* the failure.
|
|
4844
4933
|
*
|
|
4845
|
-
* **
|
|
4934
|
+
* **Details**
|
|
4935
|
+
*
|
|
4936
|
+
* When to Recover from Defects:
|
|
4846
4937
|
*
|
|
4847
4938
|
* Defects are unexpected errors that typically shouldn't be recovered from, as
|
|
4848
4939
|
* they often indicate serious issues. However, in some cases, such as
|
|
@@ -4875,14 +4966,16 @@ export const catchCause: {
|
|
|
4875
4966
|
* Handles both recoverable and unrecoverable errors by providing a recovery
|
|
4876
4967
|
* effect.
|
|
4877
4968
|
*
|
|
4878
|
-
* **When to
|
|
4969
|
+
* **When to use**
|
|
4879
4970
|
*
|
|
4880
4971
|
* The `catchCause` function allows you to handle all errors, including
|
|
4881
4972
|
* unrecoverable defects, by providing a recovery effect. The recovery logic is
|
|
4882
4973
|
* based on the `Cause` of the error, which provides detailed information about
|
|
4883
4974
|
* the failure.
|
|
4884
4975
|
*
|
|
4885
|
-
* **
|
|
4976
|
+
* **Details**
|
|
4977
|
+
*
|
|
4978
|
+
* When to Recover from Defects:
|
|
4886
4979
|
*
|
|
4887
4980
|
* Defects are unexpected errors that typically shouldn't be recovered from, as
|
|
4888
4981
|
* they often indicate serious issues. However, in some cases, such as
|
|
@@ -4916,7 +5009,7 @@ export const catchCause: {
|
|
|
4916
5009
|
/**
|
|
4917
5010
|
* Recovers from defects using a provided recovery function.
|
|
4918
5011
|
*
|
|
4919
|
-
* **When to
|
|
5012
|
+
* **When to use**
|
|
4920
5013
|
*
|
|
4921
5014
|
* Use this sparingly, usually at integration boundaries where defects must be
|
|
4922
5015
|
* reported or translated for an external system.
|
|
@@ -4926,7 +5019,7 @@ export const catchCause: {
|
|
|
4926
5019
|
* `catchDefect` handles unexpected defects, such as thrown exceptions or
|
|
4927
5020
|
* values passed to `die`, without catching typed failures or interruptions.
|
|
4928
5021
|
*
|
|
4929
|
-
*
|
|
5022
|
+
* When to Recover from Defects:
|
|
4930
5023
|
*
|
|
4931
5024
|
* Defects are unexpected errors that typically should not be recovered from, as
|
|
4932
5025
|
* they often indicate serious issues. In some cases, such as dynamically loaded
|
|
@@ -4957,7 +5050,7 @@ export const catchDefect: {
|
|
|
4957
5050
|
/**
|
|
4958
5051
|
* Recovers from defects using a provided recovery function.
|
|
4959
5052
|
*
|
|
4960
|
-
* **When to
|
|
5053
|
+
* **When to use**
|
|
4961
5054
|
*
|
|
4962
5055
|
* Use this sparingly, usually at integration boundaries where defects must be
|
|
4963
5056
|
* reported or translated for an external system.
|
|
@@ -4967,7 +5060,7 @@ export const catchDefect: {
|
|
|
4967
5060
|
* `catchDefect` handles unexpected defects, such as thrown exceptions or
|
|
4968
5061
|
* values passed to `die`, without catching typed failures or interruptions.
|
|
4969
5062
|
*
|
|
4970
|
-
*
|
|
5063
|
+
* When to Recover from Defects:
|
|
4971
5064
|
*
|
|
4972
5065
|
* Defects are unexpected errors that typically should not be recovered from, as
|
|
4973
5066
|
* they often indicate serious issues. In some cases, such as dynamically loaded
|
|
@@ -4998,7 +5091,7 @@ export const catchDefect: {
|
|
|
4998
5091
|
/**
|
|
4999
5092
|
* Recovers from defects using a provided recovery function.
|
|
5000
5093
|
*
|
|
5001
|
-
* **When to
|
|
5094
|
+
* **When to use**
|
|
5002
5095
|
*
|
|
5003
5096
|
* Use this sparingly, usually at integration boundaries where defects must be
|
|
5004
5097
|
* reported or translated for an external system.
|
|
@@ -5008,7 +5101,7 @@ export const catchDefect: {
|
|
|
5008
5101
|
* `catchDefect` handles unexpected defects, such as thrown exceptions or
|
|
5009
5102
|
* values passed to `die`, without catching typed failures or interruptions.
|
|
5010
5103
|
*
|
|
5011
|
-
*
|
|
5104
|
+
* When to Recover from Defects:
|
|
5012
5105
|
*
|
|
5013
5106
|
* Defects are unexpected errors that typically should not be recovered from, as
|
|
5014
5107
|
* they often indicate serious issues. In some cases, such as dynamically loaded
|
|
@@ -5041,7 +5134,7 @@ export const catchDefect: {
|
|
|
5041
5134
|
/**
|
|
5042
5135
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
5043
5136
|
*
|
|
5044
|
-
* **When to
|
|
5137
|
+
* **When to use**
|
|
5045
5138
|
*
|
|
5046
5139
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
5047
5140
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -5081,7 +5174,7 @@ export const catchIf: {
|
|
|
5081
5174
|
/**
|
|
5082
5175
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
5083
5176
|
*
|
|
5084
|
-
* **When to
|
|
5177
|
+
* **When to use**
|
|
5085
5178
|
*
|
|
5086
5179
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
5087
5180
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -5125,7 +5218,7 @@ export const catchIf: {
|
|
|
5125
5218
|
/**
|
|
5126
5219
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
5127
5220
|
*
|
|
5128
|
-
* **When to
|
|
5221
|
+
* **When to use**
|
|
5129
5222
|
*
|
|
5130
5223
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
5131
5224
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -5169,7 +5262,7 @@ export const catchIf: {
|
|
|
5169
5262
|
/**
|
|
5170
5263
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
5171
5264
|
*
|
|
5172
|
-
* **When to
|
|
5265
|
+
* **When to use**
|
|
5173
5266
|
*
|
|
5174
5267
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
5175
5268
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -5214,7 +5307,7 @@ export const catchIf: {
|
|
|
5214
5307
|
/**
|
|
5215
5308
|
* Recovers from specific errors using a `Predicate` or `Refinement`.
|
|
5216
5309
|
*
|
|
5217
|
-
* **When to
|
|
5310
|
+
* **When to use**
|
|
5218
5311
|
*
|
|
5219
5312
|
* `catchIf` lets you recover from errors that match a condition. Use a
|
|
5220
5313
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
@@ -5293,6 +5386,8 @@ export const catchFilter: {
|
|
|
5293
5386
|
/**
|
|
5294
5387
|
* Catches `NoSuchElementError` failures and converts them to `Option.none`.
|
|
5295
5388
|
*
|
|
5389
|
+
* **Details**
|
|
5390
|
+
*
|
|
5296
5391
|
* Success values become `Option.some`, `NoSuchElementError` becomes
|
|
5297
5392
|
* `Option.none`, and all other errors are preserved.
|
|
5298
5393
|
*
|
|
@@ -5318,6 +5413,8 @@ export const catchNoSuchElement: <A, E, R>(
|
|
|
5318
5413
|
/**
|
|
5319
5414
|
* Recovers from specific failures based on a predicate.
|
|
5320
5415
|
*
|
|
5416
|
+
* **Details**
|
|
5417
|
+
*
|
|
5321
5418
|
* This function allows you to conditionally catch and recover from failures
|
|
5322
5419
|
* that match a specific predicate. This is useful when you want to handle
|
|
5323
5420
|
* only certain types of errors while letting others propagate.
|
|
@@ -5352,6 +5449,8 @@ export const catchCauseIf: {
|
|
|
5352
5449
|
/**
|
|
5353
5450
|
* Recovers from specific failures based on a predicate.
|
|
5354
5451
|
*
|
|
5452
|
+
* **Details**
|
|
5453
|
+
*
|
|
5355
5454
|
* This function allows you to conditionally catch and recover from failures
|
|
5356
5455
|
* that match a specific predicate. This is useful when you want to handle
|
|
5357
5456
|
* only certain types of errors while letting others propagate.
|
|
@@ -5389,6 +5488,8 @@ export const catchCauseIf: {
|
|
|
5389
5488
|
/**
|
|
5390
5489
|
* Recovers from specific failures based on a predicate.
|
|
5391
5490
|
*
|
|
5491
|
+
* **Details**
|
|
5492
|
+
*
|
|
5392
5493
|
* This function allows you to conditionally catch and recover from failures
|
|
5393
5494
|
* that match a specific predicate. This is useful when you want to handle
|
|
5394
5495
|
* only certain types of errors while letting others propagate.
|
|
@@ -5460,15 +5561,13 @@ export const catchCauseFilter: {
|
|
|
5460
5561
|
* The `mapError` function is used to transform or modify the error
|
|
5461
5562
|
* produced by an effect, without affecting its success value.
|
|
5462
5563
|
*
|
|
5564
|
+
* **Details**
|
|
5565
|
+
*
|
|
5463
5566
|
* This function is helpful when you want to enhance the error with additional
|
|
5464
5567
|
* information, change the error type, or apply custom error handling while
|
|
5465
5568
|
* keeping the original behavior of the effect's success values intact. It only
|
|
5466
5569
|
* operates on the error channel and leaves the success channel unchanged.
|
|
5467
5570
|
*
|
|
5468
|
-
* @see {@link map} for a version that operates on the success channel.
|
|
5469
|
-
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5470
|
-
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5471
|
-
*
|
|
5472
5571
|
* **Example** (Transforming the error channel)
|
|
5473
5572
|
*
|
|
5474
5573
|
* ```ts
|
|
@@ -5488,6 +5587,9 @@ export const catchCauseFilter: {
|
|
|
5488
5587
|
* )
|
|
5489
5588
|
* ```
|
|
5490
5589
|
*
|
|
5590
|
+
* @see {@link map} for a version that operates on the success channel.
|
|
5591
|
+
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5592
|
+
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5491
5593
|
* @category error handling
|
|
5492
5594
|
* @since 2.0.0
|
|
5493
5595
|
*/
|
|
@@ -5496,15 +5598,13 @@ export const mapError: {
|
|
|
5496
5598
|
* The `mapError` function is used to transform or modify the error
|
|
5497
5599
|
* produced by an effect, without affecting its success value.
|
|
5498
5600
|
*
|
|
5601
|
+
* **Details**
|
|
5602
|
+
*
|
|
5499
5603
|
* This function is helpful when you want to enhance the error with additional
|
|
5500
5604
|
* information, change the error type, or apply custom error handling while
|
|
5501
5605
|
* keeping the original behavior of the effect's success values intact. It only
|
|
5502
5606
|
* operates on the error channel and leaves the success channel unchanged.
|
|
5503
5607
|
*
|
|
5504
|
-
* @see {@link map} for a version that operates on the success channel.
|
|
5505
|
-
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5506
|
-
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5507
|
-
*
|
|
5508
5608
|
* **Example** (Transforming the error channel)
|
|
5509
5609
|
*
|
|
5510
5610
|
* ```ts
|
|
@@ -5524,6 +5624,9 @@ export const mapError: {
|
|
|
5524
5624
|
* )
|
|
5525
5625
|
* ```
|
|
5526
5626
|
*
|
|
5627
|
+
* @see {@link map} for a version that operates on the success channel.
|
|
5628
|
+
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5629
|
+
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5527
5630
|
* @category error handling
|
|
5528
5631
|
* @since 2.0.0
|
|
5529
5632
|
*/
|
|
@@ -5532,15 +5635,13 @@ export const mapError: {
|
|
|
5532
5635
|
* The `mapError` function is used to transform or modify the error
|
|
5533
5636
|
* produced by an effect, without affecting its success value.
|
|
5534
5637
|
*
|
|
5638
|
+
* **Details**
|
|
5639
|
+
*
|
|
5535
5640
|
* This function is helpful when you want to enhance the error with additional
|
|
5536
5641
|
* information, change the error type, or apply custom error handling while
|
|
5537
5642
|
* keeping the original behavior of the effect's success values intact. It only
|
|
5538
5643
|
* operates on the error channel and leaves the success channel unchanged.
|
|
5539
5644
|
*
|
|
5540
|
-
* @see {@link map} for a version that operates on the success channel.
|
|
5541
|
-
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5542
|
-
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5543
|
-
*
|
|
5544
5645
|
* **Example** (Transforming the error channel)
|
|
5545
5646
|
*
|
|
5546
5647
|
* ```ts
|
|
@@ -5560,6 +5661,9 @@ export const mapError: {
|
|
|
5560
5661
|
* )
|
|
5561
5662
|
* ```
|
|
5562
5663
|
*
|
|
5664
|
+
* @see {@link map} for a version that operates on the success channel.
|
|
5665
|
+
* @see {@link mapBoth} for a version that operates on both channels.
|
|
5666
|
+
* @see {@link mapError} if you want to replace the error with a new one.
|
|
5563
5667
|
* @category error handling
|
|
5564
5668
|
* @since 2.0.0
|
|
5565
5669
|
*/
|
|
@@ -5685,13 +5789,11 @@ export const mapBoth: {
|
|
|
5685
5789
|
* Converts typed failures from the error channel into defects, removing the
|
|
5686
5790
|
* error type from the returned effect.
|
|
5687
5791
|
*
|
|
5688
|
-
* **When to
|
|
5792
|
+
* **When to use**
|
|
5689
5793
|
*
|
|
5690
5794
|
* Use `orDie` when a typed failure represents an unrecoverable bug or invalid
|
|
5691
5795
|
* state and should not be handled as a recoverable error.
|
|
5692
5796
|
*
|
|
5693
|
-
* @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
|
|
5694
|
-
*
|
|
5695
5797
|
* **Example** (Converting typed failures into defects)
|
|
5696
5798
|
*
|
|
5697
5799
|
* ```ts
|
|
@@ -5714,6 +5816,7 @@ export const mapBoth: {
|
|
|
5714
5816
|
* // ...stack trace...
|
|
5715
5817
|
* ```
|
|
5716
5818
|
*
|
|
5819
|
+
* @see {@link mapError} to transform the error before converting it into a defect with {@link orDie}.
|
|
5717
5820
|
* @category Converting Failures to Defects
|
|
5718
5821
|
* @since 2.0.0
|
|
5719
5822
|
*/
|
|
@@ -5823,6 +5926,8 @@ export const tapError: {
|
|
|
5823
5926
|
/**
|
|
5824
5927
|
* Runs an effectful handler when a failure's `_tag` matches.
|
|
5825
5928
|
*
|
|
5929
|
+
* **Details**
|
|
5930
|
+
*
|
|
5826
5931
|
* Use this with tagged-union errors to perform side effects for one tag or a
|
|
5827
5932
|
* list of tags. When the handler succeeds, the original failure is preserved;
|
|
5828
5933
|
* if the handler fails, its error is also included in the returned effect.
|
|
@@ -5859,6 +5964,8 @@ export const tapErrorTag: {
|
|
|
5859
5964
|
/**
|
|
5860
5965
|
* Runs an effectful handler when a failure's `_tag` matches.
|
|
5861
5966
|
*
|
|
5967
|
+
* **Details**
|
|
5968
|
+
*
|
|
5862
5969
|
* Use this with tagged-union errors to perform side effects for one tag or a
|
|
5863
5970
|
* list of tags. When the handler succeeds, the original failure is preserved;
|
|
5864
5971
|
* if the handler fails, its error is also included in the returned effect.
|
|
@@ -5898,6 +6005,8 @@ export const tapErrorTag: {
|
|
|
5898
6005
|
/**
|
|
5899
6006
|
* Runs an effectful handler when a failure's `_tag` matches.
|
|
5900
6007
|
*
|
|
6008
|
+
* **Details**
|
|
6009
|
+
*
|
|
5901
6010
|
* Use this with tagged-union errors to perform side effects for one tag or a
|
|
5902
6011
|
* list of tags. When the handler succeeds, the original failure is preserved;
|
|
5903
6012
|
* if the handler fails, its error is also included in the returned effect.
|
|
@@ -6043,6 +6152,8 @@ export const tapCause: {
|
|
|
6043
6152
|
/**
|
|
6044
6153
|
* Conditionally executes a side effect based on the cause of a failed effect.
|
|
6045
6154
|
*
|
|
6155
|
+
* **Details**
|
|
6156
|
+
*
|
|
6046
6157
|
* This function allows you to tap into the cause of an effect's failure only when
|
|
6047
6158
|
* the cause matches a specific predicate. This is useful for conditional logging,
|
|
6048
6159
|
* monitoring, or other side effects based on the type of failure.
|
|
@@ -6073,6 +6184,8 @@ export const tapCauseIf: {
|
|
|
6073
6184
|
/**
|
|
6074
6185
|
* Conditionally executes a side effect based on the cause of a failed effect.
|
|
6075
6186
|
*
|
|
6187
|
+
* **Details**
|
|
6188
|
+
*
|
|
6076
6189
|
* This function allows you to tap into the cause of an effect's failure only when
|
|
6077
6190
|
* the cause matches a specific predicate. This is useful for conditional logging,
|
|
6078
6191
|
* monitoring, or other side effects based on the type of failure.
|
|
@@ -6106,6 +6219,8 @@ export const tapCauseIf: {
|
|
|
6106
6219
|
/**
|
|
6107
6220
|
* Conditionally executes a side effect based on the cause of a failed effect.
|
|
6108
6221
|
*
|
|
6222
|
+
* **Details**
|
|
6223
|
+
*
|
|
6109
6224
|
* This function allows you to tap into the cause of an effect's failure only when
|
|
6110
6225
|
* the cause matches a specific predicate. This is useful for conditional logging,
|
|
6111
6226
|
* monitoring, or other side effects based on the type of failure.
|
|
@@ -6318,6 +6433,8 @@ export const tapDefect: {
|
|
|
6318
6433
|
/**
|
|
6319
6434
|
* Retries an effect until it succeeds, discarding failures.
|
|
6320
6435
|
*
|
|
6436
|
+
* **Details**
|
|
6437
|
+
*
|
|
6321
6438
|
* Yields between attempts so other fibers can run.
|
|
6322
6439
|
*
|
|
6323
6440
|
* **Example** (Retrying until success)
|
|
@@ -6407,6 +6524,11 @@ export declare namespace Retry {
|
|
|
6407
6524
|
/**
|
|
6408
6525
|
* Retries typed failures from an effect according to a retry policy.
|
|
6409
6526
|
*
|
|
6527
|
+
* **When to use**
|
|
6528
|
+
*
|
|
6529
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6530
|
+
* temporary resource unavailability.
|
|
6531
|
+
*
|
|
6410
6532
|
* **Details**
|
|
6411
6533
|
*
|
|
6412
6534
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6416,11 +6538,6 @@ export declare namespace Retry {
|
|
|
6416
6538
|
*
|
|
6417
6539
|
* Defects and interruptions are not retried as typed failures.
|
|
6418
6540
|
*
|
|
6419
|
-
* **When to Use**
|
|
6420
|
-
*
|
|
6421
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6422
|
-
* temporary resource unavailability.
|
|
6423
|
-
*
|
|
6424
6541
|
* **Example** (Retrying with a schedule)
|
|
6425
6542
|
*
|
|
6426
6543
|
* ```ts
|
|
@@ -6447,7 +6564,6 @@ export declare namespace Retry {
|
|
|
6447
6564
|
*
|
|
6448
6565
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6449
6566
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6450
|
-
*
|
|
6451
6567
|
* @category error handling
|
|
6452
6568
|
* @since 2.0.0
|
|
6453
6569
|
*/
|
|
@@ -6455,6 +6571,11 @@ export const retry: {
|
|
|
6455
6571
|
/**
|
|
6456
6572
|
* Retries typed failures from an effect according to a retry policy.
|
|
6457
6573
|
*
|
|
6574
|
+
* **When to use**
|
|
6575
|
+
*
|
|
6576
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6577
|
+
* temporary resource unavailability.
|
|
6578
|
+
*
|
|
6458
6579
|
* **Details**
|
|
6459
6580
|
*
|
|
6460
6581
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6464,11 +6585,6 @@ export const retry: {
|
|
|
6464
6585
|
*
|
|
6465
6586
|
* Defects and interruptions are not retried as typed failures.
|
|
6466
6587
|
*
|
|
6467
|
-
* **When to Use**
|
|
6468
|
-
*
|
|
6469
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6470
|
-
* temporary resource unavailability.
|
|
6471
|
-
*
|
|
6472
6588
|
* **Example** (Retrying with a schedule)
|
|
6473
6589
|
*
|
|
6474
6590
|
* ```ts
|
|
@@ -6495,7 +6611,6 @@ export const retry: {
|
|
|
6495
6611
|
*
|
|
6496
6612
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6497
6613
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6498
|
-
*
|
|
6499
6614
|
* @category error handling
|
|
6500
6615
|
* @since 2.0.0
|
|
6501
6616
|
*/
|
|
@@ -6503,6 +6618,11 @@ export const retry: {
|
|
|
6503
6618
|
/**
|
|
6504
6619
|
* Retries typed failures from an effect according to a retry policy.
|
|
6505
6620
|
*
|
|
6621
|
+
* **When to use**
|
|
6622
|
+
*
|
|
6623
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6624
|
+
* temporary resource unavailability.
|
|
6625
|
+
*
|
|
6506
6626
|
* **Details**
|
|
6507
6627
|
*
|
|
6508
6628
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6512,11 +6632,6 @@ export const retry: {
|
|
|
6512
6632
|
*
|
|
6513
6633
|
* Defects and interruptions are not retried as typed failures.
|
|
6514
6634
|
*
|
|
6515
|
-
* **When to Use**
|
|
6516
|
-
*
|
|
6517
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6518
|
-
* temporary resource unavailability.
|
|
6519
|
-
*
|
|
6520
6635
|
* **Example** (Retrying with a schedule)
|
|
6521
6636
|
*
|
|
6522
6637
|
* ```ts
|
|
@@ -6543,7 +6658,6 @@ export const retry: {
|
|
|
6543
6658
|
*
|
|
6544
6659
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6545
6660
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6546
|
-
*
|
|
6547
6661
|
* @category error handling
|
|
6548
6662
|
* @since 2.0.0
|
|
6549
6663
|
*/
|
|
@@ -6551,6 +6665,11 @@ export const retry: {
|
|
|
6551
6665
|
/**
|
|
6552
6666
|
* Retries typed failures from an effect according to a retry policy.
|
|
6553
6667
|
*
|
|
6668
|
+
* **When to use**
|
|
6669
|
+
*
|
|
6670
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6671
|
+
* temporary resource unavailability.
|
|
6672
|
+
*
|
|
6554
6673
|
* **Details**
|
|
6555
6674
|
*
|
|
6556
6675
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6560,11 +6679,6 @@ export const retry: {
|
|
|
6560
6679
|
*
|
|
6561
6680
|
* Defects and interruptions are not retried as typed failures.
|
|
6562
6681
|
*
|
|
6563
|
-
* **When to Use**
|
|
6564
|
-
*
|
|
6565
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6566
|
-
* temporary resource unavailability.
|
|
6567
|
-
*
|
|
6568
6682
|
* **Example** (Retrying with a schedule)
|
|
6569
6683
|
*
|
|
6570
6684
|
* ```ts
|
|
@@ -6591,7 +6705,6 @@ export const retry: {
|
|
|
6591
6705
|
*
|
|
6592
6706
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6593
6707
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6594
|
-
*
|
|
6595
6708
|
* @category error handling
|
|
6596
6709
|
* @since 2.0.0
|
|
6597
6710
|
*/
|
|
@@ -6603,6 +6716,11 @@ export const retry: {
|
|
|
6603
6716
|
/**
|
|
6604
6717
|
* Retries typed failures from an effect according to a retry policy.
|
|
6605
6718
|
*
|
|
6719
|
+
* **When to use**
|
|
6720
|
+
*
|
|
6721
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6722
|
+
* temporary resource unavailability.
|
|
6723
|
+
*
|
|
6606
6724
|
* **Details**
|
|
6607
6725
|
*
|
|
6608
6726
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6612,11 +6730,6 @@ export const retry: {
|
|
|
6612
6730
|
*
|
|
6613
6731
|
* Defects and interruptions are not retried as typed failures.
|
|
6614
6732
|
*
|
|
6615
|
-
* **When to Use**
|
|
6616
|
-
*
|
|
6617
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6618
|
-
* temporary resource unavailability.
|
|
6619
|
-
*
|
|
6620
6733
|
* **Example** (Retrying with a schedule)
|
|
6621
6734
|
*
|
|
6622
6735
|
* ```ts
|
|
@@ -6643,7 +6756,6 @@ export const retry: {
|
|
|
6643
6756
|
*
|
|
6644
6757
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6645
6758
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6646
|
-
*
|
|
6647
6759
|
* @category error handling
|
|
6648
6760
|
* @since 2.0.0
|
|
6649
6761
|
*/
|
|
@@ -6651,6 +6763,11 @@ export const retry: {
|
|
|
6651
6763
|
/**
|
|
6652
6764
|
* Retries typed failures from an effect according to a retry policy.
|
|
6653
6765
|
*
|
|
6766
|
+
* **When to use**
|
|
6767
|
+
*
|
|
6768
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6769
|
+
* temporary resource unavailability.
|
|
6770
|
+
*
|
|
6654
6771
|
* **Details**
|
|
6655
6772
|
*
|
|
6656
6773
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6660,11 +6777,6 @@ export const retry: {
|
|
|
6660
6777
|
*
|
|
6661
6778
|
* Defects and interruptions are not retried as typed failures.
|
|
6662
6779
|
*
|
|
6663
|
-
* **When to Use**
|
|
6664
|
-
*
|
|
6665
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6666
|
-
* temporary resource unavailability.
|
|
6667
|
-
*
|
|
6668
6780
|
* **Example** (Retrying with a schedule)
|
|
6669
6781
|
*
|
|
6670
6782
|
* ```ts
|
|
@@ -6691,7 +6803,6 @@ export const retry: {
|
|
|
6691
6803
|
*
|
|
6692
6804
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6693
6805
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6694
|
-
*
|
|
6695
6806
|
* @category error handling
|
|
6696
6807
|
* @since 2.0.0
|
|
6697
6808
|
*/
|
|
@@ -6699,6 +6810,11 @@ export const retry: {
|
|
|
6699
6810
|
/**
|
|
6700
6811
|
* Retries typed failures from an effect according to a retry policy.
|
|
6701
6812
|
*
|
|
6813
|
+
* **When to use**
|
|
6814
|
+
*
|
|
6815
|
+
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6816
|
+
* temporary resource unavailability.
|
|
6817
|
+
*
|
|
6702
6818
|
* **Details**
|
|
6703
6819
|
*
|
|
6704
6820
|
* The policy can be a `Schedule`, a schedule builder, or a `Retry.Options`
|
|
@@ -6708,11 +6824,6 @@ export const retry: {
|
|
|
6708
6824
|
*
|
|
6709
6825
|
* Defects and interruptions are not retried as typed failures.
|
|
6710
6826
|
*
|
|
6711
|
-
* **When to Use**
|
|
6712
|
-
*
|
|
6713
|
-
* Use `retry` when typed failures may be transient, such as network issues or
|
|
6714
|
-
* temporary resource unavailability.
|
|
6715
|
-
*
|
|
6716
6827
|
* **Example** (Retrying with a schedule)
|
|
6717
6828
|
*
|
|
6718
6829
|
* ```ts
|
|
@@ -6739,7 +6850,6 @@ export const retry: {
|
|
|
6739
6850
|
*
|
|
6740
6851
|
* @see {@link retryOrElse} for a version that allows you to run a fallback.
|
|
6741
6852
|
* @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.
|
|
6742
|
-
*
|
|
6743
6853
|
* @category error handling
|
|
6744
6854
|
* @since 2.0.0
|
|
6745
6855
|
*/
|
|
@@ -6754,6 +6864,11 @@ export const retry: {
|
|
|
6754
6864
|
/**
|
|
6755
6865
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
6756
6866
|
*
|
|
6867
|
+
* **When to use**
|
|
6868
|
+
*
|
|
6869
|
+
* This function is useful when you want to handle failures gracefully by
|
|
6870
|
+
* specifying an alternative action after repeated failures.
|
|
6871
|
+
*
|
|
6757
6872
|
* **Details**
|
|
6758
6873
|
*
|
|
6759
6874
|
* The `Effect.retryOrElse` function attempts to retry a failing effect multiple
|
|
@@ -6762,13 +6877,6 @@ export const retry: {
|
|
|
6762
6877
|
* If the retries are exhausted and the effect still fails, it runs a fallback
|
|
6763
6878
|
* effect instead.
|
|
6764
6879
|
*
|
|
6765
|
-
* **When to Use**
|
|
6766
|
-
*
|
|
6767
|
-
* This function is useful when you want to handle failures gracefully by
|
|
6768
|
-
* specifying an alternative action after repeated failures.
|
|
6769
|
-
*
|
|
6770
|
-
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6771
|
-
*
|
|
6772
6880
|
* **Example** (Falling back after retries are exhausted)
|
|
6773
6881
|
*
|
|
6774
6882
|
* ```ts
|
|
@@ -6805,6 +6913,7 @@ export const retry: {
|
|
|
6805
6913
|
* // Network data
|
|
6806
6914
|
* ```
|
|
6807
6915
|
*
|
|
6916
|
+
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6808
6917
|
* @category error handling
|
|
6809
6918
|
* @since 2.0.0
|
|
6810
6919
|
*/
|
|
@@ -6812,6 +6921,11 @@ export const retryOrElse: {
|
|
|
6812
6921
|
/**
|
|
6813
6922
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
6814
6923
|
*
|
|
6924
|
+
* **When to use**
|
|
6925
|
+
*
|
|
6926
|
+
* This function is useful when you want to handle failures gracefully by
|
|
6927
|
+
* specifying an alternative action after repeated failures.
|
|
6928
|
+
*
|
|
6815
6929
|
* **Details**
|
|
6816
6930
|
*
|
|
6817
6931
|
* The `Effect.retryOrElse` function attempts to retry a failing effect multiple
|
|
@@ -6820,13 +6934,6 @@ export const retryOrElse: {
|
|
|
6820
6934
|
* If the retries are exhausted and the effect still fails, it runs a fallback
|
|
6821
6935
|
* effect instead.
|
|
6822
6936
|
*
|
|
6823
|
-
* **When to Use**
|
|
6824
|
-
*
|
|
6825
|
-
* This function is useful when you want to handle failures gracefully by
|
|
6826
|
-
* specifying an alternative action after repeated failures.
|
|
6827
|
-
*
|
|
6828
|
-
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6829
|
-
*
|
|
6830
6937
|
* **Example** (Falling back after retries are exhausted)
|
|
6831
6938
|
*
|
|
6832
6939
|
* ```ts
|
|
@@ -6863,6 +6970,7 @@ export const retryOrElse: {
|
|
|
6863
6970
|
* // Network data
|
|
6864
6971
|
* ```
|
|
6865
6972
|
*
|
|
6973
|
+
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6866
6974
|
* @category error handling
|
|
6867
6975
|
* @since 2.0.0
|
|
6868
6976
|
*/
|
|
@@ -6873,6 +6981,11 @@ export const retryOrElse: {
|
|
|
6873
6981
|
/**
|
|
6874
6982
|
* Retries a failing effect and runs a fallback effect if retries are exhausted.
|
|
6875
6983
|
*
|
|
6984
|
+
* **When to use**
|
|
6985
|
+
*
|
|
6986
|
+
* This function is useful when you want to handle failures gracefully by
|
|
6987
|
+
* specifying an alternative action after repeated failures.
|
|
6988
|
+
*
|
|
6876
6989
|
* **Details**
|
|
6877
6990
|
*
|
|
6878
6991
|
* The `Effect.retryOrElse` function attempts to retry a failing effect multiple
|
|
@@ -6881,13 +6994,6 @@ export const retryOrElse: {
|
|
|
6881
6994
|
* If the retries are exhausted and the effect still fails, it runs a fallback
|
|
6882
6995
|
* effect instead.
|
|
6883
6996
|
*
|
|
6884
|
-
* **When to Use**
|
|
6885
|
-
*
|
|
6886
|
-
* This function is useful when you want to handle failures gracefully by
|
|
6887
|
-
* specifying an alternative action after repeated failures.
|
|
6888
|
-
*
|
|
6889
|
-
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6890
|
-
*
|
|
6891
6997
|
* **Example** (Falling back after retries are exhausted)
|
|
6892
6998
|
*
|
|
6893
6999
|
* ```ts
|
|
@@ -6924,6 +7030,7 @@ export const retryOrElse: {
|
|
|
6924
7030
|
* // Network data
|
|
6925
7031
|
* ```
|
|
6926
7032
|
*
|
|
7033
|
+
* @see {@link retry} for a version that does not run a fallback effect.
|
|
6927
7034
|
* @category error handling
|
|
6928
7035
|
* @since 2.0.0
|
|
6929
7036
|
*/
|
|
@@ -6972,7 +7079,7 @@ export const sandbox: <A, E, R>(
|
|
|
6972
7079
|
/**
|
|
6973
7080
|
* Discards both the success and failure values of an effect.
|
|
6974
7081
|
*
|
|
6975
|
-
* **When to
|
|
7082
|
+
* **When to use**
|
|
6976
7083
|
*
|
|
6977
7084
|
* `ignore` allows you to run an effect without caring about its result, whether
|
|
6978
7085
|
* it succeeds or fails. This is useful when you only care about the side
|
|
@@ -7029,6 +7136,8 @@ export const ignore: <
|
|
|
7029
7136
|
/**
|
|
7030
7137
|
* Ignores the effect's failure cause, including defects and interruptions.
|
|
7031
7138
|
*
|
|
7139
|
+
* **Details**
|
|
7140
|
+
*
|
|
7032
7141
|
* Use the `log` option to emit the full {@link Cause} when the effect fails,
|
|
7033
7142
|
* and `message` to prepend a custom log message.
|
|
7034
7143
|
*
|
|
@@ -7067,6 +7176,8 @@ export const ignoreCause: <
|
|
|
7067
7176
|
* Apply an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
7068
7177
|
* until it succeeds or the plan is exhausted.
|
|
7069
7178
|
*
|
|
7179
|
+
* **Details**
|
|
7180
|
+
*
|
|
7070
7181
|
* Each attempt updates `ExecutionPlan.CurrentMetadata` (attempt and step index),
|
|
7071
7182
|
* and retry timing is derived per step (the first attempt uses the remaining
|
|
7072
7183
|
* attempts schedule; later retries apply the step schedule at least once).
|
|
@@ -7102,6 +7213,8 @@ export const withExecutionPlan: {
|
|
|
7102
7213
|
* Apply an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
7103
7214
|
* until it succeeds or the plan is exhausted.
|
|
7104
7215
|
*
|
|
7216
|
+
* **Details**
|
|
7217
|
+
*
|
|
7105
7218
|
* Each attempt updates `ExecutionPlan.CurrentMetadata` (attempt and step index),
|
|
7106
7219
|
* and retry timing is derived per step (the first attempt uses the remaining
|
|
7107
7220
|
* attempts schedule; later retries apply the step schedule at least once).
|
|
@@ -7141,6 +7254,8 @@ export const withExecutionPlan: {
|
|
|
7141
7254
|
* Apply an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
7142
7255
|
* until it succeeds or the plan is exhausted.
|
|
7143
7256
|
*
|
|
7257
|
+
* **Details**
|
|
7258
|
+
*
|
|
7144
7259
|
* Each attempt updates `ExecutionPlan.CurrentMetadata` (attempt and step index),
|
|
7145
7260
|
* and retry timing is derived per step (the first attempt uses the remaining
|
|
7146
7261
|
* attempts schedule; later retries apply the step schedule at least once).
|
|
@@ -7180,6 +7295,8 @@ export const withExecutionPlan: {
|
|
|
7180
7295
|
/**
|
|
7181
7296
|
* Runs an effect and reports any errors to the configured `ErrorReporter`s.
|
|
7182
7297
|
*
|
|
7298
|
+
* **Details**
|
|
7299
|
+
*
|
|
7183
7300
|
* If the `defectsOnly` option is set to `true`, only defects (unrecoverable
|
|
7184
7301
|
* errors) will be reported, while regular failures will be ignored.
|
|
7185
7302
|
*
|
|
@@ -7325,6 +7442,12 @@ export const orElseSucceed: {
|
|
|
7325
7442
|
* Runs a sequence of effects and returns the result of the first successful
|
|
7326
7443
|
* one.
|
|
7327
7444
|
*
|
|
7445
|
+
* **When to use**
|
|
7446
|
+
*
|
|
7447
|
+
* Use `firstSuccessOf` when you have prioritized fallback strategies, such as
|
|
7448
|
+
* attempting multiple APIs, reading configuration from several sources, or
|
|
7449
|
+
* trying alternative resource locations in order.
|
|
7450
|
+
*
|
|
7328
7451
|
* **Details**
|
|
7329
7452
|
*
|
|
7330
7453
|
* This function executes the provided effects in sequence, stopping at the
|
|
@@ -7335,12 +7458,6 @@ export const orElseSucceed: {
|
|
|
7335
7458
|
* effect. If the collection is empty, the returned effect defects with an
|
|
7336
7459
|
* `Error` whose message is `"Received an empty collection of effects"`.
|
|
7337
7460
|
*
|
|
7338
|
-
* **When to Use**
|
|
7339
|
-
*
|
|
7340
|
-
* Use `firstSuccessOf` when you have prioritized fallback strategies, such as
|
|
7341
|
-
* attempting multiple APIs, reading configuration from several sources, or
|
|
7342
|
-
* trying alternative resource locations in order.
|
|
7343
|
-
*
|
|
7344
7461
|
* **Example** (Trying alternatives until one succeeds)
|
|
7345
7462
|
*
|
|
7346
7463
|
* ```ts
|
|
@@ -7377,14 +7494,14 @@ export const firstSuccessOf: <Eff extends Effect<any, any, any>>(
|
|
|
7377
7494
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
7378
7495
|
* the duration.
|
|
7379
7496
|
*
|
|
7497
|
+
* **Details**
|
|
7498
|
+
*
|
|
7380
7499
|
* The `timeout` function allows you to specify a time limit for an
|
|
7381
7500
|
* effect's execution. If the effect does not complete within the given time, a
|
|
7382
7501
|
* `TimeoutException` is raised. This can be useful for controlling how long
|
|
7383
7502
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
7384
7503
|
* indefinitely if the task takes too long.
|
|
7385
7504
|
*
|
|
7386
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
7387
|
-
*
|
|
7388
7505
|
* **Example** (Failing when work takes too long)
|
|
7389
7506
|
*
|
|
7390
7507
|
* ```ts
|
|
@@ -7415,6 +7532,7 @@ export const firstSuccessOf: <Eff extends Effect<any, any, any>>(
|
|
|
7415
7532
|
* // }
|
|
7416
7533
|
* ```
|
|
7417
7534
|
*
|
|
7535
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
7418
7536
|
* @category Delays & Timeouts
|
|
7419
7537
|
* @since 2.0.0
|
|
7420
7538
|
*/
|
|
@@ -7427,14 +7545,14 @@ export const timeout: {
|
|
|
7427
7545
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
7428
7546
|
* the duration.
|
|
7429
7547
|
*
|
|
7548
|
+
* **Details**
|
|
7549
|
+
*
|
|
7430
7550
|
* The `timeout` function allows you to specify a time limit for an
|
|
7431
7551
|
* effect's execution. If the effect does not complete within the given time, a
|
|
7432
7552
|
* `TimeoutException` is raised. This can be useful for controlling how long
|
|
7433
7553
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
7434
7554
|
* indefinitely if the task takes too long.
|
|
7435
7555
|
*
|
|
7436
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
7437
|
-
*
|
|
7438
7556
|
* **Example** (Failing when work takes too long)
|
|
7439
7557
|
*
|
|
7440
7558
|
* ```ts
|
|
@@ -7465,6 +7583,7 @@ export const timeout: {
|
|
|
7465
7583
|
* // }
|
|
7466
7584
|
* ```
|
|
7467
7585
|
*
|
|
7586
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
7468
7587
|
* @category Delays & Timeouts
|
|
7469
7588
|
* @since 2.0.0
|
|
7470
7589
|
*/
|
|
@@ -7477,14 +7596,14 @@ export const timeout: {
|
|
|
7477
7596
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
7478
7597
|
* the duration.
|
|
7479
7598
|
*
|
|
7599
|
+
* **Details**
|
|
7600
|
+
*
|
|
7480
7601
|
* The `timeout` function allows you to specify a time limit for an
|
|
7481
7602
|
* effect's execution. If the effect does not complete within the given time, a
|
|
7482
7603
|
* `TimeoutException` is raised. This can be useful for controlling how long
|
|
7483
7604
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
7484
7605
|
* indefinitely if the task takes too long.
|
|
7485
7606
|
*
|
|
7486
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
7487
|
-
*
|
|
7488
7607
|
* **Example** (Failing when work takes too long)
|
|
7489
7608
|
*
|
|
7490
7609
|
* ```ts
|
|
@@ -7515,6 +7634,7 @@ export const timeout: {
|
|
|
7515
7634
|
* // }
|
|
7516
7635
|
* ```
|
|
7517
7636
|
*
|
|
7637
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
7518
7638
|
* @category Delays & Timeouts
|
|
7519
7639
|
* @since 2.0.0
|
|
7520
7640
|
*/
|
|
@@ -7664,6 +7784,8 @@ export const timeoutOption: {
|
|
|
7664
7784
|
/**
|
|
7665
7785
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
7666
7786
|
*
|
|
7787
|
+
* **Details**
|
|
7788
|
+
*
|
|
7667
7789
|
* This function is useful when you want to set a maximum duration for an operation
|
|
7668
7790
|
* and provide an alternative action if the timeout is exceeded.
|
|
7669
7791
|
*
|
|
@@ -7702,6 +7824,8 @@ export const timeoutOrElse: {
|
|
|
7702
7824
|
/**
|
|
7703
7825
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
7704
7826
|
*
|
|
7827
|
+
* **Details**
|
|
7828
|
+
*
|
|
7705
7829
|
* This function is useful when you want to set a maximum duration for an operation
|
|
7706
7830
|
* and provide an alternative action if the timeout is exceeded.
|
|
7707
7831
|
*
|
|
@@ -7745,6 +7869,8 @@ export const timeoutOrElse: {
|
|
|
7745
7869
|
/**
|
|
7746
7870
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
7747
7871
|
*
|
|
7872
|
+
* **Details**
|
|
7873
|
+
*
|
|
7748
7874
|
* This function is useful when you want to set a maximum duration for an operation
|
|
7749
7875
|
* and provide an alternative action if the timeout is exceeded.
|
|
7750
7876
|
*
|
|
@@ -7884,6 +8010,8 @@ export const sleep: (duration: Duration.Input) => Effect<void> = internal.sleep
|
|
|
7884
8010
|
/**
|
|
7885
8011
|
* Measures the runtime of an effect and returns the duration with its result.
|
|
7886
8012
|
*
|
|
8013
|
+
* **Details**
|
|
8014
|
+
*
|
|
7887
8015
|
* The original success, failure, or interruption is preserved; only the success
|
|
7888
8016
|
* value is paired with the duration.
|
|
7889
8017
|
*
|
|
@@ -7911,6 +8039,11 @@ export const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration: Durati
|
|
|
7911
8039
|
/**
|
|
7912
8040
|
* Runs multiple effects concurrently and returns the first successful result.
|
|
7913
8041
|
*
|
|
8042
|
+
* **When to use**
|
|
8043
|
+
*
|
|
8044
|
+
* Use `raceAll` when early failures should be ignored until a success occurs
|
|
8045
|
+
* or all effects fail.
|
|
8046
|
+
*
|
|
7914
8047
|
* **Details**
|
|
7915
8048
|
*
|
|
7916
8049
|
* Early failures do not finish the race; `raceAll` keeps waiting until one
|
|
@@ -7918,13 +8051,6 @@ export const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration: Durati
|
|
|
7918
8051
|
* remaining effects are interrupted. If every effect fails, the returned effect
|
|
7919
8052
|
* fails with a cause containing the collected failure reasons.
|
|
7920
8053
|
*
|
|
7921
|
-
* **When to Use**
|
|
7922
|
-
*
|
|
7923
|
-
* Use `raceAll` when early failures should be ignored until a success occurs
|
|
7924
|
-
* or all effects fail.
|
|
7925
|
-
*
|
|
7926
|
-
* @see {@link race} for a version that handles only two effects.
|
|
7927
|
-
*
|
|
7928
8054
|
* **Example** (Racing many effects)
|
|
7929
8055
|
*
|
|
7930
8056
|
* ```ts
|
|
@@ -7941,6 +8067,7 @@ export const timed: <A, E, R>(self: Effect<A, E, R>) => Effect<[duration: Durati
|
|
|
7941
8067
|
* // Result: "Fast" (after ~100ms)
|
|
7942
8068
|
* ```
|
|
7943
8069
|
*
|
|
8070
|
+
* @see {@link race} for a version that handles only two effects.
|
|
7944
8071
|
* @category Racing
|
|
7945
8072
|
* @since 2.0.0
|
|
7946
8073
|
*/
|
|
@@ -7998,6 +8125,8 @@ export const raceAllFirst: <Eff extends Effect<any, any, any>>(
|
|
|
7998
8125
|
/**
|
|
7999
8126
|
* Races two effects and returns the first successful result.
|
|
8000
8127
|
*
|
|
8128
|
+
* **Details**
|
|
8129
|
+
*
|
|
8001
8130
|
* If one effect succeeds, the other is interrupted and `onWinner` can observe the
|
|
8002
8131
|
* winning fiber. If both fail, the race fails.
|
|
8003
8132
|
*
|
|
@@ -8025,6 +8154,8 @@ export const race: {
|
|
|
8025
8154
|
/**
|
|
8026
8155
|
* Races two effects and returns the first successful result.
|
|
8027
8156
|
*
|
|
8157
|
+
* **Details**
|
|
8158
|
+
*
|
|
8028
8159
|
* If one effect succeeds, the other is interrupted and `onWinner` can observe the
|
|
8029
8160
|
* winning fiber. If both fail, the race fails.
|
|
8030
8161
|
*
|
|
@@ -8059,6 +8190,8 @@ export const race: {
|
|
|
8059
8190
|
/**
|
|
8060
8191
|
* Races two effects and returns the first successful result.
|
|
8061
8192
|
*
|
|
8193
|
+
* **Details**
|
|
8194
|
+
*
|
|
8062
8195
|
* If one effect succeeds, the other is interrupted and `onWinner` can observe the
|
|
8063
8196
|
* winning fiber. If both fail, the race fails.
|
|
8064
8197
|
*
|
|
@@ -8097,6 +8230,8 @@ export const race: {
|
|
|
8097
8230
|
* Races two effects and returns the result of the first one to complete, whether
|
|
8098
8231
|
* it succeeds or fails.
|
|
8099
8232
|
*
|
|
8233
|
+
* **Details**
|
|
8234
|
+
*
|
|
8100
8235
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
8101
8236
|
*
|
|
8102
8237
|
* **Example** (Observing the winning fiber)
|
|
@@ -8127,6 +8262,8 @@ export const raceFirst: {
|
|
|
8127
8262
|
* Races two effects and returns the result of the first one to complete, whether
|
|
8128
8263
|
* it succeeds or fails.
|
|
8129
8264
|
*
|
|
8265
|
+
* **Details**
|
|
8266
|
+
*
|
|
8130
8267
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
8131
8268
|
*
|
|
8132
8269
|
* **Example** (Observing the winning fiber)
|
|
@@ -8164,6 +8301,8 @@ export const raceFirst: {
|
|
|
8164
8301
|
* Races two effects and returns the result of the first one to complete, whether
|
|
8165
8302
|
* it succeeds or fails.
|
|
8166
8303
|
*
|
|
8304
|
+
* **Details**
|
|
8305
|
+
*
|
|
8167
8306
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
8168
8307
|
*
|
|
8169
8308
|
* **Example** (Observing the winning fiber)
|
|
@@ -8994,6 +9133,11 @@ export const filterMapOrFail: {
|
|
|
8994
9133
|
* Conditionally runs an effect based on the result of an effectful boolean
|
|
8995
9134
|
* condition.
|
|
8996
9135
|
*
|
|
9136
|
+
* **When to use**
|
|
9137
|
+
*
|
|
9138
|
+
* Use this when an effectful check decides whether to run another effect while
|
|
9139
|
+
* representing the skipped case explicitly.
|
|
9140
|
+
*
|
|
8997
9141
|
* **Details**
|
|
8998
9142
|
*
|
|
8999
9143
|
* The condition effect is evaluated first. If it succeeds with `true`, the
|
|
@@ -9001,11 +9145,6 @@ export const filterMapOrFail: {
|
|
|
9001
9145
|
* succeeds with `false`, the source effect is skipped and the result is
|
|
9002
9146
|
* `Option.none`. If the condition effect fails, that failure is preserved.
|
|
9003
9147
|
*
|
|
9004
|
-
* **When to Use**
|
|
9005
|
-
*
|
|
9006
|
-
* Use this when an effectful check decides whether to run another effect while
|
|
9007
|
-
* representing the skipped case explicitly.
|
|
9008
|
-
*
|
|
9009
9148
|
* **Example** (Conditionally running an effect)
|
|
9010
9149
|
*
|
|
9011
9150
|
* ```ts
|
|
@@ -9024,7 +9163,6 @@ export const filterMapOrFail: {
|
|
|
9024
9163
|
* ```
|
|
9025
9164
|
*
|
|
9026
9165
|
* @see {@link when} for conditional execution with a boolean condition.
|
|
9027
|
-
*
|
|
9028
9166
|
* @category Conditional Operators
|
|
9029
9167
|
* @since 2.0.0
|
|
9030
9168
|
*/
|
|
@@ -9037,6 +9175,11 @@ export const when: {
|
|
|
9037
9175
|
* Conditionally runs an effect based on the result of an effectful boolean
|
|
9038
9176
|
* condition.
|
|
9039
9177
|
*
|
|
9178
|
+
* **When to use**
|
|
9179
|
+
*
|
|
9180
|
+
* Use this when an effectful check decides whether to run another effect while
|
|
9181
|
+
* representing the skipped case explicitly.
|
|
9182
|
+
*
|
|
9040
9183
|
* **Details**
|
|
9041
9184
|
*
|
|
9042
9185
|
* The condition effect is evaluated first. If it succeeds with `true`, the
|
|
@@ -9044,11 +9187,6 @@ export const when: {
|
|
|
9044
9187
|
* succeeds with `false`, the source effect is skipped and the result is
|
|
9045
9188
|
* `Option.none`. If the condition effect fails, that failure is preserved.
|
|
9046
9189
|
*
|
|
9047
|
-
* **When to Use**
|
|
9048
|
-
*
|
|
9049
|
-
* Use this when an effectful check decides whether to run another effect while
|
|
9050
|
-
* representing the skipped case explicitly.
|
|
9051
|
-
*
|
|
9052
9190
|
* **Example** (Conditionally running an effect)
|
|
9053
9191
|
*
|
|
9054
9192
|
* ```ts
|
|
@@ -9067,7 +9205,6 @@ export const when: {
|
|
|
9067
9205
|
* ```
|
|
9068
9206
|
*
|
|
9069
9207
|
* @see {@link when} for conditional execution with a boolean condition.
|
|
9070
|
-
*
|
|
9071
9208
|
* @category Conditional Operators
|
|
9072
9209
|
* @since 2.0.0
|
|
9073
9210
|
*/
|
|
@@ -9080,6 +9217,11 @@ export const when: {
|
|
|
9080
9217
|
* Conditionally runs an effect based on the result of an effectful boolean
|
|
9081
9218
|
* condition.
|
|
9082
9219
|
*
|
|
9220
|
+
* **When to use**
|
|
9221
|
+
*
|
|
9222
|
+
* Use this when an effectful check decides whether to run another effect while
|
|
9223
|
+
* representing the skipped case explicitly.
|
|
9224
|
+
*
|
|
9083
9225
|
* **Details**
|
|
9084
9226
|
*
|
|
9085
9227
|
* The condition effect is evaluated first. If it succeeds with `true`, the
|
|
@@ -9087,11 +9229,6 @@ export const when: {
|
|
|
9087
9229
|
* succeeds with `false`, the source effect is skipped and the result is
|
|
9088
9230
|
* `Option.none`. If the condition effect fails, that failure is preserved.
|
|
9089
9231
|
*
|
|
9090
|
-
* **When to Use**
|
|
9091
|
-
*
|
|
9092
|
-
* Use this when an effectful check decides whether to run another effect while
|
|
9093
|
-
* representing the skipped case explicitly.
|
|
9094
|
-
*
|
|
9095
9232
|
* **Example** (Conditionally running an effect)
|
|
9096
9233
|
*
|
|
9097
9234
|
* ```ts
|
|
@@ -9110,7 +9247,6 @@ export const when: {
|
|
|
9110
9247
|
* ```
|
|
9111
9248
|
*
|
|
9112
9249
|
* @see {@link when} for conditional execution with a boolean condition.
|
|
9113
|
-
*
|
|
9114
9250
|
* @category Conditional Operators
|
|
9115
9251
|
* @since 2.0.0
|
|
9116
9252
|
*/
|
|
@@ -9125,6 +9261,11 @@ export const when: {
|
|
|
9125
9261
|
* Handles both success and failure cases of an effect without performing side
|
|
9126
9262
|
* effects.
|
|
9127
9263
|
*
|
|
9264
|
+
* **When to use**
|
|
9265
|
+
*
|
|
9266
|
+
* This is useful for structuring your code to respond differently to success or
|
|
9267
|
+
* failure without triggering side effects.
|
|
9268
|
+
*
|
|
9128
9269
|
* **Details**
|
|
9129
9270
|
*
|
|
9130
9271
|
* `match` lets you define custom handlers for both success and failure
|
|
@@ -9132,13 +9273,6 @@ export const when: {
|
|
|
9132
9273
|
* to process the result if the effect succeeds, or handle the error if the
|
|
9133
9274
|
* effect fails.
|
|
9134
9275
|
*
|
|
9135
|
-
* **When to Use**
|
|
9136
|
-
*
|
|
9137
|
-
* This is useful for structuring your code to respond differently to success or
|
|
9138
|
-
* failure without triggering side effects.
|
|
9139
|
-
*
|
|
9140
|
-
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9141
|
-
*
|
|
9142
9276
|
* **Example** (Matching success and failure values)
|
|
9143
9277
|
*
|
|
9144
9278
|
* ```ts
|
|
@@ -9171,6 +9305,7 @@ export const when: {
|
|
|
9171
9305
|
* // Output: "failure: Uh oh!"
|
|
9172
9306
|
* ```
|
|
9173
9307
|
*
|
|
9308
|
+
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9174
9309
|
* @category Pattern Matching
|
|
9175
9310
|
* @since 2.0.0
|
|
9176
9311
|
*/
|
|
@@ -9183,6 +9318,11 @@ export const match: {
|
|
|
9183
9318
|
* Handles both success and failure cases of an effect without performing side
|
|
9184
9319
|
* effects.
|
|
9185
9320
|
*
|
|
9321
|
+
* **When to use**
|
|
9322
|
+
*
|
|
9323
|
+
* This is useful for structuring your code to respond differently to success or
|
|
9324
|
+
* failure without triggering side effects.
|
|
9325
|
+
*
|
|
9186
9326
|
* **Details**
|
|
9187
9327
|
*
|
|
9188
9328
|
* `match` lets you define custom handlers for both success and failure
|
|
@@ -9190,14 +9330,7 @@ export const match: {
|
|
|
9190
9330
|
* to process the result if the effect succeeds, or handle the error if the
|
|
9191
9331
|
* effect fails.
|
|
9192
9332
|
*
|
|
9193
|
-
* **
|
|
9194
|
-
*
|
|
9195
|
-
* This is useful for structuring your code to respond differently to success or
|
|
9196
|
-
* failure without triggering side effects.
|
|
9197
|
-
*
|
|
9198
|
-
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9199
|
-
*
|
|
9200
|
-
* **Example** (Matching success and failure values)
|
|
9333
|
+
* **Example** (Matching success and failure values)
|
|
9201
9334
|
*
|
|
9202
9335
|
* ```ts
|
|
9203
9336
|
* import { Data, Effect } from "effect"
|
|
@@ -9229,6 +9362,7 @@ export const match: {
|
|
|
9229
9362
|
* // Output: "failure: Uh oh!"
|
|
9230
9363
|
* ```
|
|
9231
9364
|
*
|
|
9365
|
+
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9232
9366
|
* @category Pattern Matching
|
|
9233
9367
|
* @since 2.0.0
|
|
9234
9368
|
*/
|
|
@@ -9246,6 +9380,11 @@ export const match: {
|
|
|
9246
9380
|
* Handles both success and failure cases of an effect without performing side
|
|
9247
9381
|
* effects.
|
|
9248
9382
|
*
|
|
9383
|
+
* **When to use**
|
|
9384
|
+
*
|
|
9385
|
+
* This is useful for structuring your code to respond differently to success or
|
|
9386
|
+
* failure without triggering side effects.
|
|
9387
|
+
*
|
|
9249
9388
|
* **Details**
|
|
9250
9389
|
*
|
|
9251
9390
|
* `match` lets you define custom handlers for both success and failure
|
|
@@ -9253,13 +9392,6 @@ export const match: {
|
|
|
9253
9392
|
* to process the result if the effect succeeds, or handle the error if the
|
|
9254
9393
|
* effect fails.
|
|
9255
9394
|
*
|
|
9256
|
-
* **When to Use**
|
|
9257
|
-
*
|
|
9258
|
-
* This is useful for structuring your code to respond differently to success or
|
|
9259
|
-
* failure without triggering side effects.
|
|
9260
|
-
*
|
|
9261
|
-
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9262
|
-
*
|
|
9263
9395
|
* **Example** (Matching success and failure values)
|
|
9264
9396
|
*
|
|
9265
9397
|
* ```ts
|
|
@@ -9292,6 +9424,7 @@ export const match: {
|
|
|
9292
9424
|
* // Output: "failure: Uh oh!"
|
|
9293
9425
|
* ```
|
|
9294
9426
|
*
|
|
9427
|
+
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9295
9428
|
* @category Pattern Matching
|
|
9296
9429
|
* @since 2.0.0
|
|
9297
9430
|
*/
|
|
@@ -9308,6 +9441,12 @@ export const match: {
|
|
|
9308
9441
|
* Handles both success and failure cases of an effect without performing side
|
|
9309
9442
|
* effects, with eager evaluation for resolved effects.
|
|
9310
9443
|
*
|
|
9444
|
+
* **When to use**
|
|
9445
|
+
*
|
|
9446
|
+
* Use this when you need to handle both success and failure cases and want
|
|
9447
|
+
* optimal performance for resolved effects. This is particularly useful in
|
|
9448
|
+
* scenarios where you frequently work with already computed values.
|
|
9449
|
+
*
|
|
9311
9450
|
* **Details**
|
|
9312
9451
|
*
|
|
9313
9452
|
* `matchEager` works like `match` but provides better performance for resolved
|
|
@@ -9315,12 +9454,6 @@ export const match: {
|
|
|
9315
9454
|
* the handlers immediately without fiber scheduling. For unresolved effects,
|
|
9316
9455
|
* it falls back to the regular `match` behavior.
|
|
9317
9456
|
*
|
|
9318
|
-
* **When to Use**
|
|
9319
|
-
*
|
|
9320
|
-
* Use this when you need to handle both success and failure cases and want
|
|
9321
|
-
* optimal performance for resolved effects. This is particularly useful in
|
|
9322
|
-
* scenarios where you frequently work with already computed values.
|
|
9323
|
-
*
|
|
9324
9457
|
* **Example** (Pattern matching eagerly when possible)
|
|
9325
9458
|
*
|
|
9326
9459
|
* ```ts
|
|
@@ -9337,7 +9470,6 @@ export const match: {
|
|
|
9337
9470
|
*
|
|
9338
9471
|
* @see {@link match} for the non-eager version.
|
|
9339
9472
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9340
|
-
*
|
|
9341
9473
|
* @category Pattern Matching
|
|
9342
9474
|
* @since 4.0.0
|
|
9343
9475
|
*/
|
|
@@ -9346,6 +9478,12 @@ export const matchEager: {
|
|
|
9346
9478
|
* Handles both success and failure cases of an effect without performing side
|
|
9347
9479
|
* effects, with eager evaluation for resolved effects.
|
|
9348
9480
|
*
|
|
9481
|
+
* **When to use**
|
|
9482
|
+
*
|
|
9483
|
+
* Use this when you need to handle both success and failure cases and want
|
|
9484
|
+
* optimal performance for resolved effects. This is particularly useful in
|
|
9485
|
+
* scenarios where you frequently work with already computed values.
|
|
9486
|
+
*
|
|
9349
9487
|
* **Details**
|
|
9350
9488
|
*
|
|
9351
9489
|
* `matchEager` works like `match` but provides better performance for resolved
|
|
@@ -9353,12 +9491,6 @@ export const matchEager: {
|
|
|
9353
9491
|
* the handlers immediately without fiber scheduling. For unresolved effects,
|
|
9354
9492
|
* it falls back to the regular `match` behavior.
|
|
9355
9493
|
*
|
|
9356
|
-
* **When to Use**
|
|
9357
|
-
*
|
|
9358
|
-
* Use this when you need to handle both success and failure cases and want
|
|
9359
|
-
* optimal performance for resolved effects. This is particularly useful in
|
|
9360
|
-
* scenarios where you frequently work with already computed values.
|
|
9361
|
-
*
|
|
9362
9494
|
* **Example** (Pattern matching eagerly when possible)
|
|
9363
9495
|
*
|
|
9364
9496
|
* ```ts
|
|
@@ -9375,7 +9507,6 @@ export const matchEager: {
|
|
|
9375
9507
|
*
|
|
9376
9508
|
* @see {@link match} for the non-eager version.
|
|
9377
9509
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9378
|
-
*
|
|
9379
9510
|
* @category Pattern Matching
|
|
9380
9511
|
* @since 4.0.0
|
|
9381
9512
|
*/
|
|
@@ -9389,6 +9520,12 @@ export const matchEager: {
|
|
|
9389
9520
|
* Handles both success and failure cases of an effect without performing side
|
|
9390
9521
|
* effects, with eager evaluation for resolved effects.
|
|
9391
9522
|
*
|
|
9523
|
+
* **When to use**
|
|
9524
|
+
*
|
|
9525
|
+
* Use this when you need to handle both success and failure cases and want
|
|
9526
|
+
* optimal performance for resolved effects. This is particularly useful in
|
|
9527
|
+
* scenarios where you frequently work with already computed values.
|
|
9528
|
+
*
|
|
9392
9529
|
* **Details**
|
|
9393
9530
|
*
|
|
9394
9531
|
* `matchEager` works like `match` but provides better performance for resolved
|
|
@@ -9396,12 +9533,6 @@ export const matchEager: {
|
|
|
9396
9533
|
* the handlers immediately without fiber scheduling. For unresolved effects,
|
|
9397
9534
|
* it falls back to the regular `match` behavior.
|
|
9398
9535
|
*
|
|
9399
|
-
* **When to Use**
|
|
9400
|
-
*
|
|
9401
|
-
* Use this when you need to handle both success and failure cases and want
|
|
9402
|
-
* optimal performance for resolved effects. This is particularly useful in
|
|
9403
|
-
* scenarios where you frequently work with already computed values.
|
|
9404
|
-
*
|
|
9405
9536
|
* **Example** (Pattern matching eagerly when possible)
|
|
9406
9537
|
*
|
|
9407
9538
|
* ```ts
|
|
@@ -9418,7 +9549,6 @@ export const matchEager: {
|
|
|
9418
9549
|
*
|
|
9419
9550
|
* @see {@link match} for the non-eager version.
|
|
9420
9551
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
9421
|
-
*
|
|
9422
9552
|
* @category Pattern Matching
|
|
9423
9553
|
* @since 4.0.0
|
|
9424
9554
|
*/
|
|
@@ -9434,17 +9564,17 @@ export const matchEager: {
|
|
|
9434
9564
|
/**
|
|
9435
9565
|
* Handles failures by matching the cause of failure.
|
|
9436
9566
|
*
|
|
9437
|
-
* **
|
|
9438
|
-
*
|
|
9439
|
-
* The `matchCause` function allows you to handle failures with access to the
|
|
9440
|
-
* full cause of the failure within a fiber.
|
|
9441
|
-
*
|
|
9442
|
-
* **When to Use**
|
|
9567
|
+
* **When to use**
|
|
9443
9568
|
*
|
|
9444
9569
|
* This is useful for differentiating between different types of errors, such as
|
|
9445
9570
|
* regular failures, defects, or interruptions. You can provide specific
|
|
9446
9571
|
* handling logic for each failure type based on the cause.
|
|
9447
9572
|
*
|
|
9573
|
+
* **Details**
|
|
9574
|
+
*
|
|
9575
|
+
* The `matchCause` function allows you to handle failures with access to the
|
|
9576
|
+
* full cause of the failure within a fiber.
|
|
9577
|
+
*
|
|
9448
9578
|
* **Example** (Matching on success or failure causes)
|
|
9449
9579
|
*
|
|
9450
9580
|
* ```ts
|
|
@@ -9464,7 +9594,6 @@ export const matchEager: {
|
|
|
9464
9594
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
9465
9595
|
* handlers.
|
|
9466
9596
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
9467
|
-
*
|
|
9468
9597
|
* @category Pattern Matching
|
|
9469
9598
|
* @since 2.0.0
|
|
9470
9599
|
*/
|
|
@@ -9472,17 +9601,17 @@ export const matchCause: {
|
|
|
9472
9601
|
/**
|
|
9473
9602
|
* Handles failures by matching the cause of failure.
|
|
9474
9603
|
*
|
|
9475
|
-
* **
|
|
9476
|
-
*
|
|
9477
|
-
* The `matchCause` function allows you to handle failures with access to the
|
|
9478
|
-
* full cause of the failure within a fiber.
|
|
9479
|
-
*
|
|
9480
|
-
* **When to Use**
|
|
9604
|
+
* **When to use**
|
|
9481
9605
|
*
|
|
9482
9606
|
* This is useful for differentiating between different types of errors, such as
|
|
9483
9607
|
* regular failures, defects, or interruptions. You can provide specific
|
|
9484
9608
|
* handling logic for each failure type based on the cause.
|
|
9485
9609
|
*
|
|
9610
|
+
* **Details**
|
|
9611
|
+
*
|
|
9612
|
+
* The `matchCause` function allows you to handle failures with access to the
|
|
9613
|
+
* full cause of the failure within a fiber.
|
|
9614
|
+
*
|
|
9486
9615
|
* **Example** (Matching on success or failure causes)
|
|
9487
9616
|
*
|
|
9488
9617
|
* ```ts
|
|
@@ -9502,7 +9631,6 @@ export const matchCause: {
|
|
|
9502
9631
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
9503
9632
|
* handlers.
|
|
9504
9633
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
9505
|
-
*
|
|
9506
9634
|
* @category Pattern Matching
|
|
9507
9635
|
* @since 2.0.0
|
|
9508
9636
|
*/
|
|
@@ -9515,17 +9643,17 @@ export const matchCause: {
|
|
|
9515
9643
|
/**
|
|
9516
9644
|
* Handles failures by matching the cause of failure.
|
|
9517
9645
|
*
|
|
9518
|
-
* **
|
|
9519
|
-
*
|
|
9520
|
-
* The `matchCause` function allows you to handle failures with access to the
|
|
9521
|
-
* full cause of the failure within a fiber.
|
|
9522
|
-
*
|
|
9523
|
-
* **When to Use**
|
|
9646
|
+
* **When to use**
|
|
9524
9647
|
*
|
|
9525
9648
|
* This is useful for differentiating between different types of errors, such as
|
|
9526
9649
|
* regular failures, defects, or interruptions. You can provide specific
|
|
9527
9650
|
* handling logic for each failure type based on the cause.
|
|
9528
9651
|
*
|
|
9652
|
+
* **Details**
|
|
9653
|
+
*
|
|
9654
|
+
* The `matchCause` function allows you to handle failures with access to the
|
|
9655
|
+
* full cause of the failure within a fiber.
|
|
9656
|
+
*
|
|
9529
9657
|
* **Example** (Matching on success or failure causes)
|
|
9530
9658
|
*
|
|
9531
9659
|
* ```ts
|
|
@@ -9545,7 +9673,6 @@ export const matchCause: {
|
|
|
9545
9673
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
9546
9674
|
* handlers.
|
|
9547
9675
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
9548
|
-
*
|
|
9549
9676
|
* @category Pattern Matching
|
|
9550
9677
|
* @since 2.0.0
|
|
9551
9678
|
*/
|
|
@@ -9561,18 +9688,18 @@ export const matchCause: {
|
|
|
9561
9688
|
/**
|
|
9562
9689
|
* Handles failures by matching the cause of failure with eager evaluation.
|
|
9563
9690
|
*
|
|
9691
|
+
* **When to use**
|
|
9692
|
+
*
|
|
9693
|
+
* This is useful when you have effects that are likely to be already resolved
|
|
9694
|
+
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
9695
|
+
* it automatically falls back to the regular `matchCause` behavior.
|
|
9696
|
+
*
|
|
9564
9697
|
* **Details**
|
|
9565
9698
|
*
|
|
9566
9699
|
* `matchCauseEager` works like `matchCause` but provides better performance for resolved
|
|
9567
9700
|
* effects by immediately applying the matching function instead of deferring it
|
|
9568
9701
|
* through the effect pipeline.
|
|
9569
9702
|
*
|
|
9570
|
-
* **When to Use**
|
|
9571
|
-
*
|
|
9572
|
-
* This is useful when you have effects that are likely to be already resolved
|
|
9573
|
-
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
9574
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
9575
|
-
*
|
|
9576
9703
|
* **Example** (Eagerly matching already completed effects)
|
|
9577
9704
|
*
|
|
9578
9705
|
* ```ts
|
|
@@ -9591,18 +9718,18 @@ export const matchCauseEager: {
|
|
|
9591
9718
|
/**
|
|
9592
9719
|
* Handles failures by matching the cause of failure with eager evaluation.
|
|
9593
9720
|
*
|
|
9721
|
+
* **When to use**
|
|
9722
|
+
*
|
|
9723
|
+
* This is useful when you have effects that are likely to be already resolved
|
|
9724
|
+
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
9725
|
+
* it automatically falls back to the regular `matchCause` behavior.
|
|
9726
|
+
*
|
|
9594
9727
|
* **Details**
|
|
9595
9728
|
*
|
|
9596
9729
|
* `matchCauseEager` works like `matchCause` but provides better performance for resolved
|
|
9597
9730
|
* effects by immediately applying the matching function instead of deferring it
|
|
9598
9731
|
* through the effect pipeline.
|
|
9599
9732
|
*
|
|
9600
|
-
* **When to Use**
|
|
9601
|
-
*
|
|
9602
|
-
* This is useful when you have effects that are likely to be already resolved
|
|
9603
|
-
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
9604
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
9605
|
-
*
|
|
9606
9733
|
* **Example** (Eagerly matching already completed effects)
|
|
9607
9734
|
*
|
|
9608
9735
|
* ```ts
|
|
@@ -9626,18 +9753,18 @@ export const matchCauseEager: {
|
|
|
9626
9753
|
/**
|
|
9627
9754
|
* Handles failures by matching the cause of failure with eager evaluation.
|
|
9628
9755
|
*
|
|
9756
|
+
* **When to use**
|
|
9757
|
+
*
|
|
9758
|
+
* This is useful when you have effects that are likely to be already resolved
|
|
9759
|
+
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
9760
|
+
* it automatically falls back to the regular `matchCause` behavior.
|
|
9761
|
+
*
|
|
9629
9762
|
* **Details**
|
|
9630
9763
|
*
|
|
9631
9764
|
* `matchCauseEager` works like `matchCause` but provides better performance for resolved
|
|
9632
9765
|
* effects by immediately applying the matching function instead of deferring it
|
|
9633
9766
|
* through the effect pipeline.
|
|
9634
9767
|
*
|
|
9635
|
-
* **When to Use**
|
|
9636
|
-
*
|
|
9637
|
-
* This is useful when you have effects that are likely to be already resolved
|
|
9638
|
-
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
9639
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
9640
|
-
*
|
|
9641
9768
|
* **Example** (Eagerly matching already completed effects)
|
|
9642
9769
|
*
|
|
9643
9770
|
* ```ts
|
|
@@ -9664,6 +9791,8 @@ export const matchCauseEager: {
|
|
|
9664
9791
|
/**
|
|
9665
9792
|
* Eagerly handles success or failure with effectful handlers when the effect is already resolved.
|
|
9666
9793
|
*
|
|
9794
|
+
* **Details**
|
|
9795
|
+
*
|
|
9667
9796
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
9668
9797
|
* {@link matchCauseEffect}.
|
|
9669
9798
|
*
|
|
@@ -9674,6 +9803,8 @@ export const matchCauseEffectEager: {
|
|
|
9674
9803
|
/**
|
|
9675
9804
|
* Eagerly handles success or failure with effectful handlers when the effect is already resolved.
|
|
9676
9805
|
*
|
|
9806
|
+
* **Details**
|
|
9807
|
+
*
|
|
9677
9808
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
9678
9809
|
* {@link matchCauseEffect}.
|
|
9679
9810
|
*
|
|
@@ -9689,6 +9820,8 @@ export const matchCauseEffectEager: {
|
|
|
9689
9820
|
/**
|
|
9690
9821
|
* Eagerly handles success or failure with effectful handlers when the effect is already resolved.
|
|
9691
9822
|
*
|
|
9823
|
+
* **Details**
|
|
9824
|
+
*
|
|
9692
9825
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
9693
9826
|
* {@link matchCauseEffect}.
|
|
9694
9827
|
*
|
|
@@ -9885,19 +10018,16 @@ export const matchCauseEffect: {
|
|
|
9885
10018
|
/**
|
|
9886
10019
|
* Handles both success and failure by running effectful handlers.
|
|
9887
10020
|
*
|
|
10021
|
+
* **When to use**
|
|
10022
|
+
*
|
|
10023
|
+
* Use this when the failure or success branch must run additional effects.
|
|
10024
|
+
*
|
|
9888
10025
|
* **Details**
|
|
9889
10026
|
*
|
|
9890
10027
|
* Use `matchEffect` when either branch needs to return an `Effect`, such as
|
|
9891
10028
|
* performing logging, recovery, notification, or other effectful work. The
|
|
9892
10029
|
* returned effect succeeds or fails according to the handler that is run.
|
|
9893
10030
|
*
|
|
9894
|
-
* **When to Use**
|
|
9895
|
-
*
|
|
9896
|
-
* Use this when the failure or success branch must run additional effects.
|
|
9897
|
-
*
|
|
9898
|
-
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9899
|
-
* result or failure.
|
|
9900
|
-
*
|
|
9901
10031
|
* **Example** (Matching success and failure with effectful handlers)
|
|
9902
10032
|
*
|
|
9903
10033
|
* ```ts
|
|
@@ -9939,6 +10069,8 @@ export const matchCauseEffect: {
|
|
|
9939
10069
|
* // failure: Uh oh!
|
|
9940
10070
|
* ```
|
|
9941
10071
|
*
|
|
10072
|
+
* @see {@link match} if you don't need side effects and only want to handle the
|
|
10073
|
+
* result or failure.
|
|
9942
10074
|
* @category Pattern Matching
|
|
9943
10075
|
* @since 2.0.0
|
|
9944
10076
|
*/
|
|
@@ -9946,19 +10078,16 @@ export const matchEffect: {
|
|
|
9946
10078
|
/**
|
|
9947
10079
|
* Handles both success and failure by running effectful handlers.
|
|
9948
10080
|
*
|
|
10081
|
+
* **When to use**
|
|
10082
|
+
*
|
|
10083
|
+
* Use this when the failure or success branch must run additional effects.
|
|
10084
|
+
*
|
|
9949
10085
|
* **Details**
|
|
9950
10086
|
*
|
|
9951
10087
|
* Use `matchEffect` when either branch needs to return an `Effect`, such as
|
|
9952
10088
|
* performing logging, recovery, notification, or other effectful work. The
|
|
9953
10089
|
* returned effect succeeds or fails according to the handler that is run.
|
|
9954
10090
|
*
|
|
9955
|
-
* **When to Use**
|
|
9956
|
-
*
|
|
9957
|
-
* Use this when the failure or success branch must run additional effects.
|
|
9958
|
-
*
|
|
9959
|
-
* @see {@link match} if you don't need side effects and only want to handle the
|
|
9960
|
-
* result or failure.
|
|
9961
|
-
*
|
|
9962
10091
|
* **Example** (Matching success and failure with effectful handlers)
|
|
9963
10092
|
*
|
|
9964
10093
|
* ```ts
|
|
@@ -10000,6 +10129,8 @@ export const matchEffect: {
|
|
|
10000
10129
|
* // failure: Uh oh!
|
|
10001
10130
|
* ```
|
|
10002
10131
|
*
|
|
10132
|
+
* @see {@link match} if you don't need side effects and only want to handle the
|
|
10133
|
+
* result or failure.
|
|
10003
10134
|
* @category Pattern Matching
|
|
10004
10135
|
* @since 2.0.0
|
|
10005
10136
|
*/
|
|
@@ -10012,19 +10143,16 @@ export const matchEffect: {
|
|
|
10012
10143
|
/**
|
|
10013
10144
|
* Handles both success and failure by running effectful handlers.
|
|
10014
10145
|
*
|
|
10146
|
+
* **When to use**
|
|
10147
|
+
*
|
|
10148
|
+
* Use this when the failure or success branch must run additional effects.
|
|
10149
|
+
*
|
|
10015
10150
|
* **Details**
|
|
10016
10151
|
*
|
|
10017
10152
|
* Use `matchEffect` when either branch needs to return an `Effect`, such as
|
|
10018
10153
|
* performing logging, recovery, notification, or other effectful work. The
|
|
10019
10154
|
* returned effect succeeds or fails according to the handler that is run.
|
|
10020
10155
|
*
|
|
10021
|
-
* **When to Use**
|
|
10022
|
-
*
|
|
10023
|
-
* Use this when the failure or success branch must run additional effects.
|
|
10024
|
-
*
|
|
10025
|
-
* @see {@link match} if you don't need side effects and only want to handle the
|
|
10026
|
-
* result or failure.
|
|
10027
|
-
*
|
|
10028
10156
|
* **Example** (Matching success and failure with effectful handlers)
|
|
10029
10157
|
*
|
|
10030
10158
|
* ```ts
|
|
@@ -10066,6 +10194,8 @@ export const matchEffect: {
|
|
|
10066
10194
|
* // failure: Uh oh!
|
|
10067
10195
|
* ```
|
|
10068
10196
|
*
|
|
10197
|
+
* @see {@link match} if you don't need side effects and only want to handle the
|
|
10198
|
+
* result or failure.
|
|
10069
10199
|
* @category Pattern Matching
|
|
10070
10200
|
* @since 2.0.0
|
|
10071
10201
|
*/
|
|
@@ -10085,6 +10215,8 @@ export const matchEffect: {
|
|
|
10085
10215
|
/**
|
|
10086
10216
|
* Determines whether an effect fails.
|
|
10087
10217
|
*
|
|
10218
|
+
* **Details**
|
|
10219
|
+
*
|
|
10088
10220
|
* Defects are not converted; if the effect dies, the resulting effect dies too.
|
|
10089
10221
|
*
|
|
10090
10222
|
* **Example** (Checking whether an effect fails)
|
|
@@ -10109,6 +10241,8 @@ export const isFailure: <A, E, R>(self: Effect<A, E, R>) => Effect<boolean, neve
|
|
|
10109
10241
|
/**
|
|
10110
10242
|
* Returns whether an effect completes successfully.
|
|
10111
10243
|
*
|
|
10244
|
+
* **Details**
|
|
10245
|
+
*
|
|
10112
10246
|
* Returns `false` for failures in the error channel, but defects still fail the
|
|
10113
10247
|
* effect.
|
|
10114
10248
|
*
|
|
@@ -10142,6 +10276,8 @@ export const isSuccess: <A, E, R>(self: Effect<A, E, R>) => Effect<boolean, neve
|
|
|
10142
10276
|
/**
|
|
10143
10277
|
* Returns the complete context.
|
|
10144
10278
|
*
|
|
10279
|
+
* **Details**
|
|
10280
|
+
*
|
|
10145
10281
|
* This function allows you to access all services that are currently available
|
|
10146
10282
|
* in the effect's environment. This can be useful for debugging, introspection,
|
|
10147
10283
|
* or when you need to pass the entire context to another function.
|
|
@@ -10183,6 +10319,8 @@ export const context: <R = never>() => Effect<Context.Context<R>, never, R> = in
|
|
|
10183
10319
|
/**
|
|
10184
10320
|
* Transforms the current context using the provided function.
|
|
10185
10321
|
*
|
|
10322
|
+
* **Details**
|
|
10323
|
+
*
|
|
10186
10324
|
* This function allows you to access the complete context and perform
|
|
10187
10325
|
* computations based on all available services. This is useful when you need
|
|
10188
10326
|
* to conditionally execute logic based on what services are available.
|
|
@@ -10832,6 +10970,8 @@ export const updateContext: {
|
|
|
10832
10970
|
* Runs an effect with a service implementation transformed by the provided
|
|
10833
10971
|
* function.
|
|
10834
10972
|
*
|
|
10973
|
+
* **Details**
|
|
10974
|
+
*
|
|
10835
10975
|
* The service must be available in the effect's context; `updateService`
|
|
10836
10976
|
* replaces it for the wrapped effect with the value returned by the updater.
|
|
10837
10977
|
*
|
|
@@ -10866,6 +11006,8 @@ export const updateService: {
|
|
|
10866
11006
|
* Runs an effect with a service implementation transformed by the provided
|
|
10867
11007
|
* function.
|
|
10868
11008
|
*
|
|
11009
|
+
* **Details**
|
|
11010
|
+
*
|
|
10869
11011
|
* The service must be available in the effect's context; `updateService`
|
|
10870
11012
|
* replaces it for the wrapped effect with the value returned by the updater.
|
|
10871
11013
|
*
|
|
@@ -10900,6 +11042,8 @@ export const updateService: {
|
|
|
10900
11042
|
* Runs an effect with a service implementation transformed by the provided
|
|
10901
11043
|
* function.
|
|
10902
11044
|
*
|
|
11045
|
+
* **Details**
|
|
11046
|
+
*
|
|
10903
11047
|
* The service must be available in the effect's context; `updateService`
|
|
10904
11048
|
* replaces it for the wrapped effect with the value returned by the updater.
|
|
10905
11049
|
*
|
|
@@ -10936,14 +11080,14 @@ export const updateService: {
|
|
|
10936
11080
|
* The `provideService` function is used to provide an actual
|
|
10937
11081
|
* implementation for a service in the context of an effect.
|
|
10938
11082
|
*
|
|
11083
|
+
* **Details**
|
|
11084
|
+
*
|
|
10939
11085
|
* This function allows you to associate a service with its implementation so
|
|
10940
11086
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10941
11087
|
* number generator), and then you use `provideService` to link that
|
|
10942
11088
|
* service to its implementation. Once the implementation is provided, the
|
|
10943
11089
|
* effect can be run successfully without further requirements.
|
|
10944
11090
|
*
|
|
10945
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10946
|
-
*
|
|
10947
11091
|
* **Example** (Providing a service value)
|
|
10948
11092
|
*
|
|
10949
11093
|
* ```ts
|
|
@@ -10975,6 +11119,7 @@ export const updateService: {
|
|
|
10975
11119
|
* // data
|
|
10976
11120
|
* ```
|
|
10977
11121
|
*
|
|
11122
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
10978
11123
|
* @category Context
|
|
10979
11124
|
* @since 2.0.0
|
|
10980
11125
|
*/
|
|
@@ -10983,14 +11128,14 @@ export const provideService: {
|
|
|
10983
11128
|
* The `provideService` function is used to provide an actual
|
|
10984
11129
|
* implementation for a service in the context of an effect.
|
|
10985
11130
|
*
|
|
11131
|
+
* **Details**
|
|
11132
|
+
*
|
|
10986
11133
|
* This function allows you to associate a service with its implementation so
|
|
10987
11134
|
* that it can be used in your program. You define the service (e.g., a random
|
|
10988
11135
|
* number generator), and then you use `provideService` to link that
|
|
10989
11136
|
* service to its implementation. Once the implementation is provided, the
|
|
10990
11137
|
* effect can be run successfully without further requirements.
|
|
10991
11138
|
*
|
|
10992
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
10993
|
-
*
|
|
10994
11139
|
* **Example** (Providing a service value)
|
|
10995
11140
|
*
|
|
10996
11141
|
* ```ts
|
|
@@ -11022,6 +11167,7 @@ export const provideService: {
|
|
|
11022
11167
|
* // data
|
|
11023
11168
|
* ```
|
|
11024
11169
|
*
|
|
11170
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
11025
11171
|
* @category Context
|
|
11026
11172
|
* @since 2.0.0
|
|
11027
11173
|
*/
|
|
@@ -11030,14 +11176,14 @@ export const provideService: {
|
|
|
11030
11176
|
* The `provideService` function is used to provide an actual
|
|
11031
11177
|
* implementation for a service in the context of an effect.
|
|
11032
11178
|
*
|
|
11179
|
+
* **Details**
|
|
11180
|
+
*
|
|
11033
11181
|
* This function allows you to associate a service with its implementation so
|
|
11034
11182
|
* that it can be used in your program. You define the service (e.g., a random
|
|
11035
11183
|
* number generator), and then you use `provideService` to link that
|
|
11036
11184
|
* service to its implementation. Once the implementation is provided, the
|
|
11037
11185
|
* effect can be run successfully without further requirements.
|
|
11038
11186
|
*
|
|
11039
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
11040
|
-
*
|
|
11041
11187
|
* **Example** (Providing a service value)
|
|
11042
11188
|
*
|
|
11043
11189
|
* ```ts
|
|
@@ -11069,6 +11215,7 @@ export const provideService: {
|
|
|
11069
11215
|
* // data
|
|
11070
11216
|
* ```
|
|
11071
11217
|
*
|
|
11218
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
11072
11219
|
* @category Context
|
|
11073
11220
|
* @since 2.0.0
|
|
11074
11221
|
*/
|
|
@@ -11077,14 +11224,14 @@ export const provideService: {
|
|
|
11077
11224
|
* The `provideService` function is used to provide an actual
|
|
11078
11225
|
* implementation for a service in the context of an effect.
|
|
11079
11226
|
*
|
|
11227
|
+
* **Details**
|
|
11228
|
+
*
|
|
11080
11229
|
* This function allows you to associate a service with its implementation so
|
|
11081
11230
|
* that it can be used in your program. You define the service (e.g., a random
|
|
11082
11231
|
* number generator), and then you use `provideService` to link that
|
|
11083
11232
|
* service to its implementation. Once the implementation is provided, the
|
|
11084
11233
|
* effect can be run successfully without further requirements.
|
|
11085
11234
|
*
|
|
11086
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
11087
|
-
*
|
|
11088
11235
|
* **Example** (Providing a service value)
|
|
11089
11236
|
*
|
|
11090
11237
|
* ```ts
|
|
@@ -11116,6 +11263,7 @@ export const provideService: {
|
|
|
11116
11263
|
* // data
|
|
11117
11264
|
* ```
|
|
11118
11265
|
*
|
|
11266
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
11119
11267
|
* @category Context
|
|
11120
11268
|
* @since 2.0.0
|
|
11121
11269
|
*/
|
|
@@ -11125,14 +11273,14 @@ export const provideService: {
|
|
|
11125
11273
|
* The `provideService` function is used to provide an actual
|
|
11126
11274
|
* implementation for a service in the context of an effect.
|
|
11127
11275
|
*
|
|
11276
|
+
* **Details**
|
|
11277
|
+
*
|
|
11128
11278
|
* This function allows you to associate a service with its implementation so
|
|
11129
11279
|
* that it can be used in your program. You define the service (e.g., a random
|
|
11130
11280
|
* number generator), and then you use `provideService` to link that
|
|
11131
11281
|
* service to its implementation. Once the implementation is provided, the
|
|
11132
11282
|
* effect can be run successfully without further requirements.
|
|
11133
11283
|
*
|
|
11134
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
11135
|
-
*
|
|
11136
11284
|
* **Example** (Providing a service value)
|
|
11137
11285
|
*
|
|
11138
11286
|
* ```ts
|
|
@@ -11164,6 +11312,7 @@ export const provideService: {
|
|
|
11164
11312
|
* // data
|
|
11165
11313
|
* ```
|
|
11166
11314
|
*
|
|
11315
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
11167
11316
|
* @category Context
|
|
11168
11317
|
* @since 2.0.0
|
|
11169
11318
|
*/
|
|
@@ -11172,14 +11321,14 @@ export const provideService: {
|
|
|
11172
11321
|
* The `provideService` function is used to provide an actual
|
|
11173
11322
|
* implementation for a service in the context of an effect.
|
|
11174
11323
|
*
|
|
11324
|
+
* **Details**
|
|
11325
|
+
*
|
|
11175
11326
|
* This function allows you to associate a service with its implementation so
|
|
11176
11327
|
* that it can be used in your program. You define the service (e.g., a random
|
|
11177
11328
|
* number generator), and then you use `provideService` to link that
|
|
11178
11329
|
* service to its implementation. Once the implementation is provided, the
|
|
11179
11330
|
* effect can be run successfully without further requirements.
|
|
11180
11331
|
*
|
|
11181
|
-
* @see {@link provide} for providing multiple layers to an effect.
|
|
11182
|
-
*
|
|
11183
11332
|
* **Example** (Providing a service value)
|
|
11184
11333
|
*
|
|
11185
11334
|
* ```ts
|
|
@@ -11211,6 +11360,7 @@ export const provideService: {
|
|
|
11211
11360
|
* // data
|
|
11212
11361
|
* ```
|
|
11213
11362
|
*
|
|
11363
|
+
* @see {@link provide} for providing multiple layers to an effect.
|
|
11214
11364
|
* @category Context
|
|
11215
11365
|
* @since 2.0.0
|
|
11216
11366
|
*/
|
|
@@ -11679,6 +11829,8 @@ export const acquireRelease: <A, E, R, R2>(
|
|
|
11679
11829
|
* This function constructs a scoped resource from an Effect that acquires a
|
|
11680
11830
|
* disposable value.
|
|
11681
11831
|
*
|
|
11832
|
+
* **Details**
|
|
11833
|
+
*
|
|
11682
11834
|
* The resource is automatically disposed when the surrounding
|
|
11683
11835
|
* {@link Scope} is closed, using {@link Symbol.dispose} for
|
|
11684
11836
|
* synchronous disposables or {@link Symbol.asyncDispose} for asynchronous
|
|
@@ -11688,8 +11840,6 @@ export const acquireRelease: <A, E, R, R2>(
|
|
|
11688
11840
|
* JavaScript disposal protocal instead of requiring an explicit release
|
|
11689
11841
|
* function.
|
|
11690
11842
|
*
|
|
11691
|
-
* @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
|
|
11692
|
-
*
|
|
11693
11843
|
* **Example** (Acquiring a disposable resource)
|
|
11694
11844
|
*
|
|
11695
11845
|
* ```ts
|
|
@@ -11710,6 +11860,7 @@ export const acquireRelease: <A, E, R, R2>(
|
|
|
11710
11860
|
* )
|
|
11711
11861
|
* ```
|
|
11712
11862
|
*
|
|
11863
|
+
* @see [JavaScript `using` declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using)
|
|
11713
11864
|
* @category resource management
|
|
11714
11865
|
* @since 4.0.0
|
|
11715
11866
|
*/
|
|
@@ -11723,6 +11874,8 @@ export const acquireDisposable: <A extends AsyncDisposable | Disposable, E, R>(
|
|
|
11723
11874
|
* etc.) will not be interrupted, and that the resource will always be released
|
|
11724
11875
|
* when the `Effect` value completes execution.
|
|
11725
11876
|
*
|
|
11877
|
+
* **Details**
|
|
11878
|
+
*
|
|
11726
11879
|
* `acquireUseRelease` does the following:
|
|
11727
11880
|
*
|
|
11728
11881
|
* 1. Ensures that the `Effect` value that acquires the resource will not be
|
|
@@ -11800,6 +11953,8 @@ export const acquireUseRelease: <Resource, E, R, A, E2, R2, E3, R3>(
|
|
|
11800
11953
|
* The finalizer is guaranteed to be run when the scope is closed, and it may
|
|
11801
11954
|
* depend on the `Exit` value that the scope is closed with.
|
|
11802
11955
|
*
|
|
11956
|
+
* **Details**
|
|
11957
|
+
*
|
|
11803
11958
|
* Finalizers are useful for cleanup operations that must run regardless of
|
|
11804
11959
|
* whether the effect succeeds or fails. They're commonly used for resource
|
|
11805
11960
|
* cleanup, logging, or other side effects that should always occur.
|
|
@@ -11846,6 +12001,8 @@ export const addFinalizer: <R>(
|
|
|
11846
12001
|
* specified `finalizer` is guaranteed to be executed, whether this effect
|
|
11847
12002
|
* succeeds, fails, or is interrupted.
|
|
11848
12003
|
*
|
|
12004
|
+
* **Details**
|
|
12005
|
+
*
|
|
11849
12006
|
* For use cases that need access to the effect's result, see `onExit`.
|
|
11850
12007
|
*
|
|
11851
12008
|
* Finalizers offer very powerful guarantees, but they are low-level, and
|
|
@@ -11887,6 +12044,8 @@ export const ensuring: {
|
|
|
11887
12044
|
* specified `finalizer` is guaranteed to be executed, whether this effect
|
|
11888
12045
|
* succeeds, fails, or is interrupted.
|
|
11889
12046
|
*
|
|
12047
|
+
* **Details**
|
|
12048
|
+
*
|
|
11890
12049
|
* For use cases that need access to the effect's result, see `onExit`.
|
|
11891
12050
|
*
|
|
11892
12051
|
* Finalizers offer very powerful guarantees, but they are low-level, and
|
|
@@ -11928,6 +12087,8 @@ export const ensuring: {
|
|
|
11928
12087
|
* specified `finalizer` is guaranteed to be executed, whether this effect
|
|
11929
12088
|
* succeeds, fails, or is interrupted.
|
|
11930
12089
|
*
|
|
12090
|
+
* **Details**
|
|
12091
|
+
*
|
|
11931
12092
|
* For use cases that need access to the effect's result, see `onExit`.
|
|
11932
12093
|
*
|
|
11933
12094
|
* Finalizers offer very powerful guarantees, but they are low-level, and
|
|
@@ -12389,24 +12550,19 @@ export const onExitFilter: {
|
|
|
12389
12550
|
* Returns an effect that lazily computes a result and caches it for subsequent
|
|
12390
12551
|
* evaluations.
|
|
12391
12552
|
*
|
|
12392
|
-
* **
|
|
12393
|
-
*
|
|
12394
|
-
* This function wraps an effect and ensures that its result is computed only
|
|
12395
|
-
* once. Once the result is computed, it is cached, meaning that subsequent
|
|
12396
|
-
* evaluations of the same effect will return the cached result without
|
|
12397
|
-
* re-executing the logic.
|
|
12398
|
-
*
|
|
12399
|
-
* **When to Use**
|
|
12553
|
+
* **When to use**
|
|
12400
12554
|
*
|
|
12401
12555
|
* Use this function when you have an expensive or time-consuming operation that
|
|
12402
12556
|
* you want to avoid repeating. The first evaluation will compute the result,
|
|
12403
12557
|
* and all following evaluations will immediately return the cached value,
|
|
12404
12558
|
* improving performance and reducing unnecessary work.
|
|
12405
12559
|
*
|
|
12406
|
-
*
|
|
12407
|
-
*
|
|
12408
|
-
*
|
|
12409
|
-
*
|
|
12560
|
+
* **Details**
|
|
12561
|
+
*
|
|
12562
|
+
* This function wraps an effect and ensures that its result is computed only
|
|
12563
|
+
* once. Once the result is computed, it is cached, meaning that subsequent
|
|
12564
|
+
* evaluations of the same effect will return the cached result without
|
|
12565
|
+
* re-executing the logic.
|
|
12410
12566
|
*
|
|
12411
12567
|
* **Example** (Memoizing an effect until invalidated)
|
|
12412
12568
|
*
|
|
@@ -12446,6 +12602,10 @@ export const onExitFilter: {
|
|
|
12446
12602
|
* // result 3
|
|
12447
12603
|
* ```
|
|
12448
12604
|
*
|
|
12605
|
+
* @see {@link cachedWithTTL} for a similar function that includes a
|
|
12606
|
+
* time-to-live duration for the cached value.
|
|
12607
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
12608
|
+
* additional effect for manually invalidating the cached value.
|
|
12449
12609
|
* @category Caching
|
|
12450
12610
|
* @since 2.0.0
|
|
12451
12611
|
*/
|
|
@@ -12455,6 +12615,17 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
|
|
|
12455
12615
|
* Returns an effect that caches its result for a specified `Duration`,
|
|
12456
12616
|
* known as "timeToLive" (TTL).
|
|
12457
12617
|
*
|
|
12618
|
+
* **When to use**
|
|
12619
|
+
*
|
|
12620
|
+
* Use this function when you have an effect that involves costly operations or
|
|
12621
|
+
* computations, and you want to avoid repeating them within a short time frame.
|
|
12622
|
+
*
|
|
12623
|
+
* It's ideal for scenarios where the result of an effect doesn't change
|
|
12624
|
+
* frequently and can be reused for a specified duration.
|
|
12625
|
+
*
|
|
12626
|
+
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
12627
|
+
* computations, especially in performance-critical applications.
|
|
12628
|
+
*
|
|
12458
12629
|
* **Details**
|
|
12459
12630
|
*
|
|
12460
12631
|
* This function is used to cache the result of an effect for a specified amount
|
|
@@ -12467,22 +12638,6 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
|
|
|
12467
12638
|
* After the specified duration has passed, the cache expires, and the effect
|
|
12468
12639
|
* will be recomputed upon the next evaluation.
|
|
12469
12640
|
*
|
|
12470
|
-
* **When to Use**
|
|
12471
|
-
*
|
|
12472
|
-
* Use this function when you have an effect that involves costly operations or
|
|
12473
|
-
* computations, and you want to avoid repeating them within a short time frame.
|
|
12474
|
-
*
|
|
12475
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
12476
|
-
* frequently and can be reused for a specified duration.
|
|
12477
|
-
*
|
|
12478
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
12479
|
-
* computations, especially in performance-critical applications.
|
|
12480
|
-
*
|
|
12481
|
-
* @see {@link cached} for a similar function that caches the result
|
|
12482
|
-
* indefinitely.
|
|
12483
|
-
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
12484
|
-
* additional effect for manually invalidating the cached value.
|
|
12485
|
-
*
|
|
12486
12641
|
* **Example** (Memoizing an effect with TTL)
|
|
12487
12642
|
*
|
|
12488
12643
|
* ```ts
|
|
@@ -12515,6 +12670,10 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
|
|
|
12515
12670
|
* // result 2
|
|
12516
12671
|
* ```
|
|
12517
12672
|
*
|
|
12673
|
+
* @see {@link cached} for a similar function that caches the result
|
|
12674
|
+
* indefinitely.
|
|
12675
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
12676
|
+
* additional effect for manually invalidating the cached value.
|
|
12518
12677
|
* @category Caching
|
|
12519
12678
|
* @since 2.0.0
|
|
12520
12679
|
*/
|
|
@@ -12523,6 +12682,17 @@ export const cachedWithTTL: {
|
|
|
12523
12682
|
* Returns an effect that caches its result for a specified `Duration`,
|
|
12524
12683
|
* known as "timeToLive" (TTL).
|
|
12525
12684
|
*
|
|
12685
|
+
* **When to use**
|
|
12686
|
+
*
|
|
12687
|
+
* Use this function when you have an effect that involves costly operations or
|
|
12688
|
+
* computations, and you want to avoid repeating them within a short time frame.
|
|
12689
|
+
*
|
|
12690
|
+
* It's ideal for scenarios where the result of an effect doesn't change
|
|
12691
|
+
* frequently and can be reused for a specified duration.
|
|
12692
|
+
*
|
|
12693
|
+
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
12694
|
+
* computations, especially in performance-critical applications.
|
|
12695
|
+
*
|
|
12526
12696
|
* **Details**
|
|
12527
12697
|
*
|
|
12528
12698
|
* This function is used to cache the result of an effect for a specified amount
|
|
@@ -12535,22 +12705,6 @@ export const cachedWithTTL: {
|
|
|
12535
12705
|
* After the specified duration has passed, the cache expires, and the effect
|
|
12536
12706
|
* will be recomputed upon the next evaluation.
|
|
12537
12707
|
*
|
|
12538
|
-
* **When to Use**
|
|
12539
|
-
*
|
|
12540
|
-
* Use this function when you have an effect that involves costly operations or
|
|
12541
|
-
* computations, and you want to avoid repeating them within a short time frame.
|
|
12542
|
-
*
|
|
12543
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
12544
|
-
* frequently and can be reused for a specified duration.
|
|
12545
|
-
*
|
|
12546
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
12547
|
-
* computations, especially in performance-critical applications.
|
|
12548
|
-
*
|
|
12549
|
-
* @see {@link cached} for a similar function that caches the result
|
|
12550
|
-
* indefinitely.
|
|
12551
|
-
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
12552
|
-
* additional effect for manually invalidating the cached value.
|
|
12553
|
-
*
|
|
12554
12708
|
* **Example** (Memoizing an effect with TTL)
|
|
12555
12709
|
*
|
|
12556
12710
|
* ```ts
|
|
@@ -12583,6 +12737,10 @@ export const cachedWithTTL: {
|
|
|
12583
12737
|
* // result 2
|
|
12584
12738
|
* ```
|
|
12585
12739
|
*
|
|
12740
|
+
* @see {@link cached} for a similar function that caches the result
|
|
12741
|
+
* indefinitely.
|
|
12742
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
12743
|
+
* additional effect for manually invalidating the cached value.
|
|
12586
12744
|
* @category Caching
|
|
12587
12745
|
* @since 2.0.0
|
|
12588
12746
|
*/
|
|
@@ -12591,19 +12749,7 @@ export const cachedWithTTL: {
|
|
|
12591
12749
|
* Returns an effect that caches its result for a specified `Duration`,
|
|
12592
12750
|
* known as "timeToLive" (TTL).
|
|
12593
12751
|
*
|
|
12594
|
-
* **
|
|
12595
|
-
*
|
|
12596
|
-
* This function is used to cache the result of an effect for a specified amount
|
|
12597
|
-
* of time. This means that the first time the effect is evaluated, its result
|
|
12598
|
-
* is computed and stored.
|
|
12599
|
-
*
|
|
12600
|
-
* If the effect is evaluated again within the specified `timeToLive`, the
|
|
12601
|
-
* cached result will be used, avoiding recomputation.
|
|
12602
|
-
*
|
|
12603
|
-
* After the specified duration has passed, the cache expires, and the effect
|
|
12604
|
-
* will be recomputed upon the next evaluation.
|
|
12605
|
-
*
|
|
12606
|
-
* **When to Use**
|
|
12752
|
+
* **When to use**
|
|
12607
12753
|
*
|
|
12608
12754
|
* Use this function when you have an effect that involves costly operations or
|
|
12609
12755
|
* computations, and you want to avoid repeating them within a short time frame.
|
|
@@ -12614,10 +12760,17 @@ export const cachedWithTTL: {
|
|
|
12614
12760
|
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
12615
12761
|
* computations, especially in performance-critical applications.
|
|
12616
12762
|
*
|
|
12617
|
-
*
|
|
12618
|
-
*
|
|
12619
|
-
*
|
|
12620
|
-
*
|
|
12763
|
+
* **Details**
|
|
12764
|
+
*
|
|
12765
|
+
* This function is used to cache the result of an effect for a specified amount
|
|
12766
|
+
* of time. This means that the first time the effect is evaluated, its result
|
|
12767
|
+
* is computed and stored.
|
|
12768
|
+
*
|
|
12769
|
+
* If the effect is evaluated again within the specified `timeToLive`, the
|
|
12770
|
+
* cached result will be used, avoiding recomputation.
|
|
12771
|
+
*
|
|
12772
|
+
* After the specified duration has passed, the cache expires, and the effect
|
|
12773
|
+
* will be recomputed upon the next evaluation.
|
|
12621
12774
|
*
|
|
12622
12775
|
* **Example** (Memoizing an effect with TTL)
|
|
12623
12776
|
*
|
|
@@ -12651,6 +12804,10 @@ export const cachedWithTTL: {
|
|
|
12651
12804
|
* // result 2
|
|
12652
12805
|
* ```
|
|
12653
12806
|
*
|
|
12807
|
+
* @see {@link cached} for a similar function that caches the result
|
|
12808
|
+
* indefinitely.
|
|
12809
|
+
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
12810
|
+
* additional effect for manually invalidating the cached value.
|
|
12654
12811
|
* @category Caching
|
|
12655
12812
|
* @since 2.0.0
|
|
12656
12813
|
*/
|
|
@@ -12661,6 +12818,16 @@ export const cachedWithTTL: {
|
|
|
12661
12818
|
* Caches an effect's result for a specified duration and allows manual
|
|
12662
12819
|
* invalidation before expiration.
|
|
12663
12820
|
*
|
|
12821
|
+
* **When to use**
|
|
12822
|
+
*
|
|
12823
|
+
* Use this function when you have an effect whose result needs to be cached for
|
|
12824
|
+
* a certain period, but you also want the option to refresh the cache manually
|
|
12825
|
+
* before the expiration time.
|
|
12826
|
+
*
|
|
12827
|
+
* This is useful when you need to ensure that the cached data remains valid for
|
|
12828
|
+
* a certain period but still want to invalidate it if the underlying data
|
|
12829
|
+
* changes or if you want to force a recomputation.
|
|
12830
|
+
*
|
|
12664
12831
|
* **Details**
|
|
12665
12832
|
*
|
|
12666
12833
|
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
@@ -12674,21 +12841,6 @@ export const cachedWithTTL: {
|
|
|
12674
12841
|
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
12675
12842
|
* result will be recomputed, and the cache will be refreshed.
|
|
12676
12843
|
*
|
|
12677
|
-
* **When to Use**
|
|
12678
|
-
*
|
|
12679
|
-
* Use this function when you have an effect whose result needs to be cached for
|
|
12680
|
-
* a certain period, but you also want the option to refresh the cache manually
|
|
12681
|
-
* before the expiration time.
|
|
12682
|
-
*
|
|
12683
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
12684
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
12685
|
-
* changes or if you want to force a recomputation.
|
|
12686
|
-
*
|
|
12687
|
-
* @see {@link cached} for a similar function that caches the result
|
|
12688
|
-
* indefinitely.
|
|
12689
|
-
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
12690
|
-
* a specified duration but does not include an effect for manual invalidation.
|
|
12691
|
-
*
|
|
12692
12844
|
* **Example** (Memoizing with TTL and invalidation)
|
|
12693
12845
|
*
|
|
12694
12846
|
* ```ts
|
|
@@ -12724,6 +12876,10 @@ export const cachedWithTTL: {
|
|
|
12724
12876
|
* // result 2
|
|
12725
12877
|
* ```
|
|
12726
12878
|
*
|
|
12879
|
+
* @see {@link cached} for a similar function that caches the result
|
|
12880
|
+
* indefinitely.
|
|
12881
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
12882
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
12727
12883
|
* @category Caching
|
|
12728
12884
|
* @since 2.0.0
|
|
12729
12885
|
*/
|
|
@@ -12732,6 +12888,16 @@ export const cachedInvalidateWithTTL: {
|
|
|
12732
12888
|
* Caches an effect's result for a specified duration and allows manual
|
|
12733
12889
|
* invalidation before expiration.
|
|
12734
12890
|
*
|
|
12891
|
+
* **When to use**
|
|
12892
|
+
*
|
|
12893
|
+
* Use this function when you have an effect whose result needs to be cached for
|
|
12894
|
+
* a certain period, but you also want the option to refresh the cache manually
|
|
12895
|
+
* before the expiration time.
|
|
12896
|
+
*
|
|
12897
|
+
* This is useful when you need to ensure that the cached data remains valid for
|
|
12898
|
+
* a certain period but still want to invalidate it if the underlying data
|
|
12899
|
+
* changes or if you want to force a recomputation.
|
|
12900
|
+
*
|
|
12735
12901
|
* **Details**
|
|
12736
12902
|
*
|
|
12737
12903
|
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
@@ -12745,21 +12911,6 @@ export const cachedInvalidateWithTTL: {
|
|
|
12745
12911
|
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
12746
12912
|
* result will be recomputed, and the cache will be refreshed.
|
|
12747
12913
|
*
|
|
12748
|
-
* **When to Use**
|
|
12749
|
-
*
|
|
12750
|
-
* Use this function when you have an effect whose result needs to be cached for
|
|
12751
|
-
* a certain period, but you also want the option to refresh the cache manually
|
|
12752
|
-
* before the expiration time.
|
|
12753
|
-
*
|
|
12754
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
12755
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
12756
|
-
* changes or if you want to force a recomputation.
|
|
12757
|
-
*
|
|
12758
|
-
* @see {@link cached} for a similar function that caches the result
|
|
12759
|
-
* indefinitely.
|
|
12760
|
-
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
12761
|
-
* a specified duration but does not include an effect for manual invalidation.
|
|
12762
|
-
*
|
|
12763
12914
|
* **Example** (Memoizing with TTL and invalidation)
|
|
12764
12915
|
*
|
|
12765
12916
|
* ```ts
|
|
@@ -12795,6 +12946,10 @@ export const cachedInvalidateWithTTL: {
|
|
|
12795
12946
|
* // result 2
|
|
12796
12947
|
* ```
|
|
12797
12948
|
*
|
|
12949
|
+
* @see {@link cached} for a similar function that caches the result
|
|
12950
|
+
* indefinitely.
|
|
12951
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
12952
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
12798
12953
|
* @category Caching
|
|
12799
12954
|
* @since 2.0.0
|
|
12800
12955
|
*/
|
|
@@ -12803,6 +12958,16 @@ export const cachedInvalidateWithTTL: {
|
|
|
12803
12958
|
* Caches an effect's result for a specified duration and allows manual
|
|
12804
12959
|
* invalidation before expiration.
|
|
12805
12960
|
*
|
|
12961
|
+
* **When to use**
|
|
12962
|
+
*
|
|
12963
|
+
* Use this function when you have an effect whose result needs to be cached for
|
|
12964
|
+
* a certain period, but you also want the option to refresh the cache manually
|
|
12965
|
+
* before the expiration time.
|
|
12966
|
+
*
|
|
12967
|
+
* This is useful when you need to ensure that the cached data remains valid for
|
|
12968
|
+
* a certain period but still want to invalidate it if the underlying data
|
|
12969
|
+
* changes or if you want to force a recomputation.
|
|
12970
|
+
*
|
|
12806
12971
|
* **Details**
|
|
12807
12972
|
*
|
|
12808
12973
|
* This function behaves similarly to {@link cachedWithTTL} by caching the
|
|
@@ -12816,21 +12981,6 @@ export const cachedInvalidateWithTTL: {
|
|
|
12816
12981
|
* Once the cache is invalidated, the next time the effect is evaluated, the
|
|
12817
12982
|
* result will be recomputed, and the cache will be refreshed.
|
|
12818
12983
|
*
|
|
12819
|
-
* **When to Use**
|
|
12820
|
-
*
|
|
12821
|
-
* Use this function when you have an effect whose result needs to be cached for
|
|
12822
|
-
* a certain period, but you also want the option to refresh the cache manually
|
|
12823
|
-
* before the expiration time.
|
|
12824
|
-
*
|
|
12825
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
12826
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
12827
|
-
* changes or if you want to force a recomputation.
|
|
12828
|
-
*
|
|
12829
|
-
* @see {@link cached} for a similar function that caches the result
|
|
12830
|
-
* indefinitely.
|
|
12831
|
-
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
12832
|
-
* a specified duration but does not include an effect for manual invalidation.
|
|
12833
|
-
*
|
|
12834
12984
|
* **Example** (Memoizing with TTL and invalidation)
|
|
12835
12985
|
*
|
|
12836
12986
|
* ```ts
|
|
@@ -12866,6 +13016,10 @@ export const cachedInvalidateWithTTL: {
|
|
|
12866
13016
|
* // result 2
|
|
12867
13017
|
* ```
|
|
12868
13018
|
*
|
|
13019
|
+
* @see {@link cached} for a similar function that caches the result
|
|
13020
|
+
* indefinitely.
|
|
13021
|
+
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
13022
|
+
* a specified duration but does not include an effect for manual invalidation.
|
|
12869
13023
|
* @category Caching
|
|
12870
13024
|
* @since 2.0.0
|
|
12871
13025
|
*/
|
|
@@ -13820,6 +13974,8 @@ export const repeatOrElse: {
|
|
|
13820
13974
|
/**
|
|
13821
13975
|
* Returns an array of `n` identical effects.
|
|
13822
13976
|
*
|
|
13977
|
+
* **Details**
|
|
13978
|
+
*
|
|
13823
13979
|
* Use with `Effect.all` to run the replicated effects and collect results.
|
|
13824
13980
|
*
|
|
13825
13981
|
* @category Collecting
|
|
@@ -13829,6 +13985,8 @@ export const replicate: {
|
|
|
13829
13985
|
/**
|
|
13830
13986
|
* Returns an array of `n` identical effects.
|
|
13831
13987
|
*
|
|
13988
|
+
* **Details**
|
|
13989
|
+
*
|
|
13832
13990
|
* Use with `Effect.all` to run the replicated effects and collect results.
|
|
13833
13991
|
*
|
|
13834
13992
|
* @category Collecting
|
|
@@ -13838,6 +13996,8 @@ export const replicate: {
|
|
|
13838
13996
|
/**
|
|
13839
13997
|
* Returns an array of `n` identical effects.
|
|
13840
13998
|
*
|
|
13999
|
+
* **Details**
|
|
14000
|
+
*
|
|
13841
14001
|
* Use with `Effect.all` to run the replicated effects and collect results.
|
|
13842
14002
|
*
|
|
13843
14003
|
* @category Collecting
|
|
@@ -13849,6 +14009,8 @@ export const replicate: {
|
|
|
13849
14009
|
/**
|
|
13850
14010
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
13851
14011
|
*
|
|
14012
|
+
* **Details**
|
|
14013
|
+
*
|
|
13852
14014
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
13853
14015
|
*
|
|
13854
14016
|
* **Example** (Replicating an effect)
|
|
@@ -13869,6 +14031,8 @@ export const replicateEffect: {
|
|
|
13869
14031
|
/**
|
|
13870
14032
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
13871
14033
|
*
|
|
14034
|
+
* **Details**
|
|
14035
|
+
*
|
|
13872
14036
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
13873
14037
|
*
|
|
13874
14038
|
* **Example** (Replicating an effect)
|
|
@@ -13892,6 +14056,8 @@ export const replicateEffect: {
|
|
|
13892
14056
|
/**
|
|
13893
14057
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
13894
14058
|
*
|
|
14059
|
+
* **Details**
|
|
14060
|
+
*
|
|
13895
14061
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
13896
14062
|
*
|
|
13897
14063
|
* **Example** (Replicating an effect)
|
|
@@ -13915,6 +14081,8 @@ export const replicateEffect: {
|
|
|
13915
14081
|
/**
|
|
13916
14082
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
13917
14083
|
*
|
|
14084
|
+
* **Details**
|
|
14085
|
+
*
|
|
13918
14086
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
13919
14087
|
*
|
|
13920
14088
|
* **Example** (Replicating an effect)
|
|
@@ -13939,6 +14107,8 @@ export const replicateEffect: {
|
|
|
13939
14107
|
/**
|
|
13940
14108
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
13941
14109
|
*
|
|
14110
|
+
* **Details**
|
|
14111
|
+
*
|
|
13942
14112
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
13943
14113
|
*
|
|
13944
14114
|
* **Example** (Replicating an effect)
|
|
@@ -14780,6 +14950,8 @@ export const spanLinks: Effect<ReadonlyArray<SpanLink>> = internal.spanLinks
|
|
|
14780
14950
|
/**
|
|
14781
14951
|
* For all spans in this effect, add a link with the provided span.
|
|
14782
14952
|
*
|
|
14953
|
+
* **Details**
|
|
14954
|
+
*
|
|
14783
14955
|
* This is useful for connecting spans that are related but not in a direct
|
|
14784
14956
|
* parent-child relationship. For example, you might want to link spans from
|
|
14785
14957
|
* parallel operations or connect spans across different traces.
|
|
@@ -14833,6 +15005,8 @@ export const linkSpans: {
|
|
|
14833
15005
|
/**
|
|
14834
15006
|
* For all spans in this effect, add a link with the provided span.
|
|
14835
15007
|
*
|
|
15008
|
+
* **Details**
|
|
15009
|
+
*
|
|
14836
15010
|
* This is useful for connecting spans that are related but not in a direct
|
|
14837
15011
|
* parent-child relationship. For example, you might want to link spans from
|
|
14838
15012
|
* parallel operations or connect spans across different traces.
|
|
@@ -14889,6 +15063,8 @@ export const linkSpans: {
|
|
|
14889
15063
|
/**
|
|
14890
15064
|
* For all spans in this effect, add a link with the provided span.
|
|
14891
15065
|
*
|
|
15066
|
+
* **Details**
|
|
15067
|
+
*
|
|
14892
15068
|
* This is useful for connecting spans that are related but not in a direct
|
|
14893
15069
|
* parent-child relationship. For example, you might want to link spans from
|
|
14894
15070
|
* parallel operations or connect spans across different traces.
|
|
@@ -14975,6 +15151,8 @@ export const makeSpan: (name: string, options?: SpanOptionsNoTrace) => Effect<Sp
|
|
|
14975
15151
|
* Create a new span for tracing, and automatically close it when the Scope
|
|
14976
15152
|
* finalizes.
|
|
14977
15153
|
*
|
|
15154
|
+
* **Details**
|
|
15155
|
+
*
|
|
14978
15156
|
* The span is not added to the current span stack, so no child spans will be
|
|
14979
15157
|
* created for it.
|
|
14980
15158
|
*
|
|
@@ -15005,6 +15183,8 @@ export const makeSpanScoped: (
|
|
|
15005
15183
|
* Create a new span for tracing, and automatically close it when the effect
|
|
15006
15184
|
* completes.
|
|
15007
15185
|
*
|
|
15186
|
+
* **Details**
|
|
15187
|
+
*
|
|
15008
15188
|
* The span is not added to the current span stack, so no child spans will be
|
|
15009
15189
|
* created for it.
|
|
15010
15190
|
*
|
|
@@ -15031,6 +15211,8 @@ export const useSpan: {
|
|
|
15031
15211
|
* Create a new span for tracing, and automatically close it when the effect
|
|
15032
15212
|
* completes.
|
|
15033
15213
|
*
|
|
15214
|
+
* **Details**
|
|
15215
|
+
*
|
|
15034
15216
|
* The span is not added to the current span stack, so no child spans will be
|
|
15035
15217
|
* created for it.
|
|
15036
15218
|
*
|
|
@@ -15057,6 +15239,8 @@ export const useSpan: {
|
|
|
15057
15239
|
* Create a new span for tracing, and automatically close it when the effect
|
|
15058
15240
|
* completes.
|
|
15059
15241
|
*
|
|
15242
|
+
* **Details**
|
|
15243
|
+
*
|
|
15060
15244
|
* The span is not added to the current span stack, so no child spans will be
|
|
15061
15245
|
* created for it.
|
|
15062
15246
|
*
|
|
@@ -15163,6 +15347,8 @@ export const withSpan: {
|
|
|
15163
15347
|
/**
|
|
15164
15348
|
* Wraps the effect with a new span for tracing.
|
|
15165
15349
|
*
|
|
15350
|
+
* **Details**
|
|
15351
|
+
*
|
|
15166
15352
|
* The span is ended when the Scope is finalized.
|
|
15167
15353
|
*
|
|
15168
15354
|
* **Example** (Creating a scoped child span)
|
|
@@ -15186,6 +15372,8 @@ export const withSpanScoped: {
|
|
|
15186
15372
|
/**
|
|
15187
15373
|
* Wraps the effect with a new span for tracing.
|
|
15188
15374
|
*
|
|
15375
|
+
* **Details**
|
|
15376
|
+
*
|
|
15189
15377
|
* The span is ended when the Scope is finalized.
|
|
15190
15378
|
*
|
|
15191
15379
|
* **Example** (Creating a scoped child span)
|
|
@@ -15211,6 +15399,8 @@ export const withSpanScoped: {
|
|
|
15211
15399
|
/**
|
|
15212
15400
|
* Wraps the effect with a new span for tracing.
|
|
15213
15401
|
*
|
|
15402
|
+
* **Details**
|
|
15403
|
+
*
|
|
15214
15404
|
* The span is ended when the Scope is finalized.
|
|
15215
15405
|
*
|
|
15216
15406
|
* **Example** (Creating a scoped child span)
|
|
@@ -15409,6 +15599,8 @@ export const request: {
|
|
|
15409
15599
|
* Low-level entry point that registers a request with a resolver and delivers the exit value via `onExit`.
|
|
15410
15600
|
* Use this when you already have a `Context` and need to enqueue a request outside an `Effect`.
|
|
15411
15601
|
*
|
|
15602
|
+
* **Details**
|
|
15603
|
+
*
|
|
15412
15604
|
* It returns a canceler that removes the pending request entry.
|
|
15413
15605
|
*
|
|
15414
15606
|
* @category Requests & Batching
|
|
@@ -15432,6 +15624,8 @@ export const requestUnsafe: <A extends Request.Any>(
|
|
|
15432
15624
|
* returning the fiber immediately, without waiting for it to begin executing
|
|
15433
15625
|
* the effect.
|
|
15434
15626
|
*
|
|
15627
|
+
* **Details**
|
|
15628
|
+
*
|
|
15435
15629
|
* You can use the `forkChild` method whenever you want to execute an effect in a
|
|
15436
15630
|
* new fiber, concurrently and without "blocking" the fiber executing other
|
|
15437
15631
|
* effects. Using fibers can be tricky, so instead of using this method
|
|
@@ -15767,7 +15961,7 @@ export interface RunOptions {
|
|
|
15767
15961
|
* The foundational function for running effects, returning a "fiber" that can
|
|
15768
15962
|
* be observed or interrupted.
|
|
15769
15963
|
*
|
|
15770
|
-
* **When to
|
|
15964
|
+
* **When to use**
|
|
15771
15965
|
*
|
|
15772
15966
|
* `runFork` is used to run an effect in the background by creating a
|
|
15773
15967
|
* fiber. It is the base function for all other run functions. It starts a fiber
|
|
@@ -15840,6 +16034,8 @@ export const runForkWith: <R>(
|
|
|
15840
16034
|
/**
|
|
15841
16035
|
* Forks an effect with the provided services, registers `onExit` as a fiber observer, and returns an interruptor.
|
|
15842
16036
|
*
|
|
16037
|
+
* **Details**
|
|
16038
|
+
*
|
|
15843
16039
|
* The returned interruptor calls `fiber.interruptUnsafe`, optionally with an interruptor id.
|
|
15844
16040
|
*
|
|
15845
16041
|
* **Example** (Running with services and a callback)
|
|
@@ -15889,6 +16085,8 @@ export const runCallbackWith: <R>(
|
|
|
15889
16085
|
* Runs an effect asynchronously, registering `onExit` as a fiber observer and
|
|
15890
16086
|
* returning an interruptor.
|
|
15891
16087
|
*
|
|
16088
|
+
* **Details**
|
|
16089
|
+
*
|
|
15892
16090
|
* The interruptor calls `fiber.interruptUnsafe` with the optional interruptor
|
|
15893
16091
|
* id.
|
|
15894
16092
|
*
|
|
@@ -15931,7 +16129,7 @@ export const runCallback: <A, E>(
|
|
|
15931
16129
|
/**
|
|
15932
16130
|
* Executes an effect and returns the result as a `Promise`.
|
|
15933
16131
|
*
|
|
15934
|
-
* **When to
|
|
16132
|
+
* **When to use**
|
|
15935
16133
|
*
|
|
15936
16134
|
* Use `runPromise` when you need to execute an effect and work with the
|
|
15937
16135
|
* result using `Promise` syntax, typically for compatibility with other
|
|
@@ -15940,8 +16138,6 @@ export const runCallback: <A, E>(
|
|
|
15940
16138
|
* If the effect succeeds, the promise will resolve with the result. If the
|
|
15941
16139
|
* effect fails, the promise will reject with an error.
|
|
15942
16140
|
*
|
|
15943
|
-
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
15944
|
-
*
|
|
15945
16141
|
* **Example** (Running a successful effect as a Promise)
|
|
15946
16142
|
*
|
|
15947
16143
|
* ```ts
|
|
@@ -15962,6 +16158,7 @@ export const runCallback: <A, E>(
|
|
|
15962
16158
|
* // (FiberFailure) Error: my error
|
|
15963
16159
|
* ```
|
|
15964
16160
|
*
|
|
16161
|
+
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
15965
16162
|
* @category Running Effects
|
|
15966
16163
|
* @since 2.0.0
|
|
15967
16164
|
*/
|
|
@@ -16007,7 +16204,7 @@ export const runPromiseWith: <R>(
|
|
|
16007
16204
|
* Runs an effect and returns a `Promise` that resolves to an `Exit`, which
|
|
16008
16205
|
* represents the outcome (success or failure) of the effect.
|
|
16009
16206
|
*
|
|
16010
|
-
* **When to
|
|
16207
|
+
* **When to use**
|
|
16011
16208
|
*
|
|
16012
16209
|
* Use `runPromiseExit` when you need to determine if an effect succeeded
|
|
16013
16210
|
* or failed, including any defects, and you want to work with a `Promise`.
|
|
@@ -16096,7 +16293,7 @@ export const runPromiseExitWith: <R>(
|
|
|
16096
16293
|
/**
|
|
16097
16294
|
* Executes an effect synchronously and returns its success value.
|
|
16098
16295
|
*
|
|
16099
|
-
* **When to
|
|
16296
|
+
* **When to use**
|
|
16100
16297
|
*
|
|
16101
16298
|
* Use `runSync` only for effects that can complete synchronously.
|
|
16102
16299
|
*
|
|
@@ -16106,9 +16303,6 @@ export const runPromiseExitWith: <R>(
|
|
|
16106
16303
|
* `runSync` throws a `FiberFailure` instead of returning a value. Use
|
|
16107
16304
|
* `runSyncExit` when you want the failure captured as an `Exit`.
|
|
16108
16305
|
*
|
|
16109
|
-
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
16110
|
-
* throwing an error.
|
|
16111
|
-
*
|
|
16112
16306
|
* **Example** (Running a synchronous effect)
|
|
16113
16307
|
*
|
|
16114
16308
|
* ```ts
|
|
@@ -16150,6 +16344,8 @@ export const runPromiseExitWith: <R>(
|
|
|
16150
16344
|
* // (FiberFailure) AsyncFiberException: Fiber #0 cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work
|
|
16151
16345
|
* ```
|
|
16152
16346
|
*
|
|
16347
|
+
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
16348
|
+
* throwing an error.
|
|
16153
16349
|
* @category Running Effects
|
|
16154
16350
|
* @since 2.0.0
|
|
16155
16351
|
*/
|
|
@@ -16193,7 +16389,7 @@ export const runSyncWith: <R>(
|
|
|
16193
16389
|
* Runs an effect synchronously and returns the result as an `Exit` type, which
|
|
16194
16390
|
* represents the outcome (success or failure) of the effect.
|
|
16195
16391
|
*
|
|
16196
|
-
* **When to
|
|
16392
|
+
* **When to use**
|
|
16197
16393
|
*
|
|
16198
16394
|
* Use `runSyncExit` to find out whether an effect succeeded or failed,
|
|
16199
16395
|
* including any defects, without dealing with asynchronous operations.
|
|
@@ -16312,11 +16508,13 @@ export const runSyncExitWith: <R>(
|
|
|
16312
16508
|
/**
|
|
16313
16509
|
* Type helpers for functions built with `Effect.fn` and `Effect.fnUntraced`.
|
|
16314
16510
|
*
|
|
16511
|
+
* **Details**
|
|
16512
|
+
*
|
|
16315
16513
|
* Use these to describe generator-based signatures and traced or untraced variants.
|
|
16316
16514
|
*
|
|
16317
16515
|
* @since 3.11.0
|
|
16318
16516
|
*/
|
|
16319
|
-
export namespace fn {
|
|
16517
|
+
export declare namespace fn {
|
|
16320
16518
|
/**
|
|
16321
16519
|
* Generator return type accepted by `Effect.fn` and `Effect.fnUntraced`.
|
|
16322
16520
|
*
|
|
@@ -20360,6 +20558,8 @@ export namespace fn {
|
|
|
20360
20558
|
/**
|
|
20361
20559
|
* Creates an Effect-returning function without tracing.
|
|
20362
20560
|
*
|
|
20561
|
+
* **Details**
|
|
20562
|
+
*
|
|
20363
20563
|
* `Effect.fnUntraced` also acts as a `pipe` function, so you can append transforms after the body.
|
|
20364
20564
|
*
|
|
20365
20565
|
* **Example** (Defining untraced effect functions)
|
|
@@ -20383,6 +20583,8 @@ export const fnUntraced: fn.Untraced = internal.fnUntraced
|
|
|
20383
20583
|
/**
|
|
20384
20584
|
* Creates a traced function with an optional span name and `SpanOptionsNoTrace` that adds spans and stack frames, plus pipeable post-processing that receives the Effect and the original arguments.
|
|
20385
20585
|
*
|
|
20586
|
+
* **Details**
|
|
20587
|
+
*
|
|
20386
20588
|
* Pipeable functions run after the body and can transform the resulting Effect.
|
|
20387
20589
|
*
|
|
20388
20590
|
* **Example** (Defining traced effect functions)
|
|
@@ -20451,6 +20653,8 @@ export const clockWith: <A, E, R>(
|
|
|
20451
20653
|
/**
|
|
20452
20654
|
* Creates a logger function that logs at the specified level.
|
|
20453
20655
|
*
|
|
20656
|
+
* **Details**
|
|
20657
|
+
*
|
|
20454
20658
|
* If no level is provided, the logger uses the fiber's current log level and
|
|
20455
20659
|
* extracts any `Cause` values from the message list.
|
|
20456
20660
|
*
|
|
@@ -20913,6 +21117,8 @@ export const annotateLogs = dual<
|
|
|
20913
21117
|
/**
|
|
20914
21118
|
* Adds log annotations to the current scope.
|
|
20915
21119
|
*
|
|
21120
|
+
* **Details**
|
|
21121
|
+
*
|
|
20916
21122
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
20917
21123
|
* `annotateLogsScoped` updates annotations for the entire current `Scope` and
|
|
20918
21124
|
* restores the previous annotations when the scope closes.
|
|
@@ -20940,6 +21146,8 @@ export const annotateLogsScoped: {
|
|
|
20940
21146
|
/**
|
|
20941
21147
|
* Adds log annotations to the current scope.
|
|
20942
21148
|
*
|
|
21149
|
+
* **Details**
|
|
21150
|
+
*
|
|
20943
21151
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
20944
21152
|
* `annotateLogsScoped` updates annotations for the entire current `Scope` and
|
|
20945
21153
|
* restores the previous annotations when the scope closes.
|
|
@@ -20967,6 +21175,8 @@ export const annotateLogsScoped: {
|
|
|
20967
21175
|
/**
|
|
20968
21176
|
* Adds log annotations to the current scope.
|
|
20969
21177
|
*
|
|
21178
|
+
* **Details**
|
|
21179
|
+
*
|
|
20970
21180
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
20971
21181
|
* `annotateLogsScoped` updates annotations for the entire current `Scope` and
|
|
20972
21182
|
* restores the previous annotations when the scope closes.
|
|
@@ -21106,6 +21316,8 @@ export const withLogSpan = dual<
|
|
|
21106
21316
|
/**
|
|
21107
21317
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
21108
21318
|
*
|
|
21319
|
+
* **Details**
|
|
21320
|
+
*
|
|
21109
21321
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
21110
21322
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21111
21323
|
*
|
|
@@ -21161,6 +21373,8 @@ export const track: {
|
|
|
21161
21373
|
/**
|
|
21162
21374
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
21163
21375
|
*
|
|
21376
|
+
* **Details**
|
|
21377
|
+
*
|
|
21164
21378
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
21165
21379
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21166
21380
|
*
|
|
@@ -21216,6 +21430,8 @@ export const track: {
|
|
|
21216
21430
|
/**
|
|
21217
21431
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
21218
21432
|
*
|
|
21433
|
+
* **Details**
|
|
21434
|
+
*
|
|
21219
21435
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
21220
21436
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21221
21437
|
*
|
|
@@ -21271,6 +21487,8 @@ export const track: {
|
|
|
21271
21487
|
/**
|
|
21272
21488
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
21273
21489
|
*
|
|
21490
|
+
* **Details**
|
|
21491
|
+
*
|
|
21274
21492
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
21275
21493
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21276
21494
|
*
|
|
@@ -21330,6 +21548,8 @@ export const track: {
|
|
|
21330
21548
|
/**
|
|
21331
21549
|
* Updates the `Metric` every time the `Effect` is executed.
|
|
21332
21550
|
*
|
|
21551
|
+
* **Details**
|
|
21552
|
+
*
|
|
21333
21553
|
* Also accepts an optional function which can be used to map the `Exit` value
|
|
21334
21554
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21335
21555
|
*
|
|
@@ -21398,6 +21618,8 @@ export const track: {
|
|
|
21398
21618
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
21399
21619
|
* a value.
|
|
21400
21620
|
*
|
|
21621
|
+
* **Details**
|
|
21622
|
+
*
|
|
21401
21623
|
* Also accepts an optional function which can be used to map the success value
|
|
21402
21624
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21403
21625
|
*
|
|
@@ -21446,6 +21668,8 @@ export const trackSuccesses: {
|
|
|
21446
21668
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
21447
21669
|
* a value.
|
|
21448
21670
|
*
|
|
21671
|
+
* **Details**
|
|
21672
|
+
*
|
|
21449
21673
|
* Also accepts an optional function which can be used to map the success value
|
|
21450
21674
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21451
21675
|
*
|
|
@@ -21494,6 +21718,8 @@ export const trackSuccesses: {
|
|
|
21494
21718
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
21495
21719
|
* a value.
|
|
21496
21720
|
*
|
|
21721
|
+
* **Details**
|
|
21722
|
+
*
|
|
21497
21723
|
* Also accepts an optional function which can be used to map the success value
|
|
21498
21724
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21499
21725
|
*
|
|
@@ -21542,6 +21768,8 @@ export const trackSuccesses: {
|
|
|
21542
21768
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
21543
21769
|
* a value.
|
|
21544
21770
|
*
|
|
21771
|
+
* **Details**
|
|
21772
|
+
*
|
|
21545
21773
|
* Also accepts an optional function which can be used to map the success value
|
|
21546
21774
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21547
21775
|
*
|
|
@@ -21594,6 +21822,8 @@ export const trackSuccesses: {
|
|
|
21594
21822
|
* Updates the provided `Metric` every time the wrapped `Effect` succeeds with
|
|
21595
21823
|
* a value.
|
|
21596
21824
|
*
|
|
21825
|
+
* **Details**
|
|
21826
|
+
*
|
|
21597
21827
|
* Also accepts an optional function which can be used to map the success value
|
|
21598
21828
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21599
21829
|
*
|
|
@@ -21655,6 +21885,8 @@ export const trackSuccesses: {
|
|
|
21655
21885
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
21656
21886
|
* **expected** error.
|
|
21657
21887
|
*
|
|
21888
|
+
* **Details**
|
|
21889
|
+
*
|
|
21658
21890
|
* Also accepts an optional function which can be used to map the error value
|
|
21659
21891
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21660
21892
|
*
|
|
@@ -21705,6 +21937,8 @@ export const trackErrors: {
|
|
|
21705
21937
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
21706
21938
|
* **expected** error.
|
|
21707
21939
|
*
|
|
21940
|
+
* **Details**
|
|
21941
|
+
*
|
|
21708
21942
|
* Also accepts an optional function which can be used to map the error value
|
|
21709
21943
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21710
21944
|
*
|
|
@@ -21755,6 +21989,8 @@ export const trackErrors: {
|
|
|
21755
21989
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
21756
21990
|
* **expected** error.
|
|
21757
21991
|
*
|
|
21992
|
+
* **Details**
|
|
21993
|
+
*
|
|
21758
21994
|
* Also accepts an optional function which can be used to map the error value
|
|
21759
21995
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21760
21996
|
*
|
|
@@ -21805,6 +22041,8 @@ export const trackErrors: {
|
|
|
21805
22041
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
21806
22042
|
* **expected** error.
|
|
21807
22043
|
*
|
|
22044
|
+
* **Details**
|
|
22045
|
+
*
|
|
21808
22046
|
* Also accepts an optional function which can be used to map the error value
|
|
21809
22047
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21810
22048
|
*
|
|
@@ -21859,6 +22097,8 @@ export const trackErrors: {
|
|
|
21859
22097
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
21860
22098
|
* **expected** error.
|
|
21861
22099
|
*
|
|
22100
|
+
* **Details**
|
|
22101
|
+
*
|
|
21862
22102
|
* Also accepts an optional function which can be used to map the error value
|
|
21863
22103
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21864
22104
|
*
|
|
@@ -21922,6 +22162,8 @@ export const trackErrors: {
|
|
|
21922
22162
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
21923
22163
|
* **unexpected** error (i.e. a defect).
|
|
21924
22164
|
*
|
|
22165
|
+
* **Details**
|
|
22166
|
+
*
|
|
21925
22167
|
* Also accepts an optional function which can be used to map the defect value
|
|
21926
22168
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21927
22169
|
*
|
|
@@ -21973,6 +22215,8 @@ export const trackDefects: {
|
|
|
21973
22215
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
21974
22216
|
* **unexpected** error (i.e. a defect).
|
|
21975
22217
|
*
|
|
22218
|
+
* **Details**
|
|
22219
|
+
*
|
|
21976
22220
|
* Also accepts an optional function which can be used to map the defect value
|
|
21977
22221
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
21978
22222
|
*
|
|
@@ -22024,6 +22268,8 @@ export const trackDefects: {
|
|
|
22024
22268
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
22025
22269
|
* **unexpected** error (i.e. a defect).
|
|
22026
22270
|
*
|
|
22271
|
+
* **Details**
|
|
22272
|
+
*
|
|
22027
22273
|
* Also accepts an optional function which can be used to map the defect value
|
|
22028
22274
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
22029
22275
|
*
|
|
@@ -22075,6 +22321,8 @@ export const trackDefects: {
|
|
|
22075
22321
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
22076
22322
|
* **unexpected** error (i.e. a defect).
|
|
22077
22323
|
*
|
|
22324
|
+
* **Details**
|
|
22325
|
+
*
|
|
22078
22326
|
* Also accepts an optional function which can be used to map the defect value
|
|
22079
22327
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
22080
22328
|
*
|
|
@@ -22130,6 +22378,8 @@ export const trackDefects: {
|
|
|
22130
22378
|
* Updates the provided `Metric` every time the wrapped `Effect` fails with an
|
|
22131
22379
|
* **unexpected** error (i.e. a defect).
|
|
22132
22380
|
*
|
|
22381
|
+
* **Details**
|
|
22382
|
+
*
|
|
22133
22383
|
* Also accepts an optional function which can be used to map the defect value
|
|
22134
22384
|
* of the `Effect` into a valid `Input` for the `Metric`.
|
|
22135
22385
|
*
|
|
@@ -22190,6 +22440,8 @@ export const trackDefects: {
|
|
|
22190
22440
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
22191
22441
|
* that the wrapped `Effect` took to complete.
|
|
22192
22442
|
*
|
|
22443
|
+
* **Details**
|
|
22444
|
+
*
|
|
22193
22445
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
22194
22446
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
22195
22447
|
* `Metric`.
|
|
@@ -22237,6 +22489,8 @@ export const trackDuration: {
|
|
|
22237
22489
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
22238
22490
|
* that the wrapped `Effect` took to complete.
|
|
22239
22491
|
*
|
|
22492
|
+
* **Details**
|
|
22493
|
+
*
|
|
22240
22494
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
22241
22495
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
22242
22496
|
* `Metric`.
|
|
@@ -22287,6 +22541,8 @@ export const trackDuration: {
|
|
|
22287
22541
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
22288
22542
|
* that the wrapped `Effect` took to complete.
|
|
22289
22543
|
*
|
|
22544
|
+
* **Details**
|
|
22545
|
+
*
|
|
22290
22546
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
22291
22547
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
22292
22548
|
* `Metric`.
|
|
@@ -22334,6 +22590,8 @@ export const trackDuration: {
|
|
|
22334
22590
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
22335
22591
|
* that the wrapped `Effect` took to complete.
|
|
22336
22592
|
*
|
|
22593
|
+
* **Details**
|
|
22594
|
+
*
|
|
22337
22595
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
22338
22596
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
22339
22597
|
* `Metric`.
|
|
@@ -22385,6 +22643,8 @@ export const trackDuration: {
|
|
|
22385
22643
|
* Updates the provided `Metric` with the `Duration` of time (in nanoseconds)
|
|
22386
22644
|
* that the wrapped `Effect` took to complete.
|
|
22387
22645
|
*
|
|
22646
|
+
* **Details**
|
|
22647
|
+
*
|
|
22388
22648
|
* Also accepts an optional function which can be used to map the `Duration`
|
|
22389
22649
|
* that the wrapped `Effect` took to complete into a valid `Input` for the
|
|
22390
22650
|
* `Metric`.
|
|
@@ -22456,6 +22716,8 @@ export const trackDuration: {
|
|
|
22456
22716
|
/**
|
|
22457
22717
|
* Service that holds the current transaction state, it includes
|
|
22458
22718
|
*
|
|
22719
|
+
* **Details**
|
|
22720
|
+
*
|
|
22459
22721
|
* - a journal that stores any non committed change to TxRef values
|
|
22460
22722
|
* - a retry flag to know if the transaction should be retried
|
|
22461
22723
|
*
|
|
@@ -22493,6 +22755,8 @@ export class Transaction extends Context.Service<
|
|
|
22493
22755
|
* Defines a transaction boundary. Transactions are "all or nothing" with respect to changes
|
|
22494
22756
|
* made to transactional values (i.e. TxRef) that occur within the transaction body.
|
|
22495
22757
|
*
|
|
22758
|
+
* **Details**
|
|
22759
|
+
*
|
|
22496
22760
|
* If called inside an active transaction, `tx` composes with the current transaction and reuses
|
|
22497
22761
|
* its journal and retry state instead of creating a nested boundary.
|
|
22498
22762
|
*
|
|
@@ -22624,10 +22888,9 @@ function clearTransaction(state: Transaction["Service"]) {
|
|
|
22624
22888
|
/**
|
|
22625
22889
|
* Signals that the current transaction needs to be retried.
|
|
22626
22890
|
*
|
|
22627
|
-
*
|
|
22891
|
+
* **Details**
|
|
22628
22892
|
*
|
|
22629
|
-
*
|
|
22630
|
-
* @since 4.0.0
|
|
22893
|
+
* NOTE: the transaction retries on any change to transactional values (i.e. TxRef) accessed in its body.
|
|
22631
22894
|
*
|
|
22632
22895
|
* **Example** (Retrying transactions)
|
|
22633
22896
|
*
|
|
@@ -22657,6 +22920,9 @@ function clearTransaction(state: Transaction["Service"]) {
|
|
|
22657
22920
|
*
|
|
22658
22921
|
* Effect.runPromise(program).catch(console.error)
|
|
22659
22922
|
* ```
|
|
22923
|
+
*
|
|
22924
|
+
* @category Transactions
|
|
22925
|
+
* @since 4.0.0
|
|
22660
22926
|
*/
|
|
22661
22927
|
export const txRetry: Effect<never, never, Transaction> = flatMap(
|
|
22662
22928
|
Transaction,
|
|
@@ -23138,6 +23404,8 @@ export const effectify: {
|
|
|
23138
23404
|
/**
|
|
23139
23405
|
* Ensures that an effect's success type extends a given type `A`.
|
|
23140
23406
|
*
|
|
23407
|
+
* **Details**
|
|
23408
|
+
*
|
|
23141
23409
|
* This function provides compile-time type checking to ensure that the success
|
|
23142
23410
|
* value of an effect conforms to a specific type constraint.
|
|
23143
23411
|
*
|
|
@@ -23166,6 +23434,8 @@ export const satisfiesSuccessType = <A>() => <A2 extends A, E, R>(effect: Effect
|
|
|
23166
23434
|
/**
|
|
23167
23435
|
* Ensures that an effect's error type extends a given type `E`.
|
|
23168
23436
|
*
|
|
23437
|
+
* **Details**
|
|
23438
|
+
*
|
|
23169
23439
|
* This function provides compile-time type checking to ensure that the error
|
|
23170
23440
|
* type of an effect conforms to a specific type constraint.
|
|
23171
23441
|
*
|
|
@@ -23196,6 +23466,8 @@ export const satisfiesErrorType = <E>() => <A, E2 extends E, R>(effect: Effect<A
|
|
|
23196
23466
|
/**
|
|
23197
23467
|
* Ensures that an effect's requirements type extends a given type `R`.
|
|
23198
23468
|
*
|
|
23469
|
+
* **Details**
|
|
23470
|
+
*
|
|
23199
23471
|
* This function provides compile-time type checking to ensure that the
|
|
23200
23472
|
* requirements (context) type of an effect conforms to a specific type constraint.
|
|
23201
23473
|
*
|
|
@@ -23225,13 +23497,15 @@ export const satisfiesServicesType = <R>() => <A, E, R2 extends R>(effect: Effec
|
|
|
23225
23497
|
* An optimized version of `map` that checks if an effect is already resolved
|
|
23226
23498
|
* and applies the mapping function eagerly when possible.
|
|
23227
23499
|
*
|
|
23228
|
-
* **When to
|
|
23500
|
+
* **When to use**
|
|
23229
23501
|
*
|
|
23230
23502
|
* `mapEager` provides better performance for effects that are already resolved
|
|
23231
23503
|
* by applying the transformation immediately instead of deferring it through
|
|
23232
23504
|
* the effect pipeline.
|
|
23233
23505
|
*
|
|
23234
|
-
* **
|
|
23506
|
+
* **Details**
|
|
23507
|
+
*
|
|
23508
|
+
* Behavior:
|
|
23235
23509
|
*
|
|
23236
23510
|
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
23237
23511
|
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
@@ -23259,13 +23533,15 @@ export const mapEager: {
|
|
|
23259
23533
|
* An optimized version of `map` that checks if an effect is already resolved
|
|
23260
23534
|
* and applies the mapping function eagerly when possible.
|
|
23261
23535
|
*
|
|
23262
|
-
* **When to
|
|
23536
|
+
* **When to use**
|
|
23263
23537
|
*
|
|
23264
23538
|
* `mapEager` provides better performance for effects that are already resolved
|
|
23265
23539
|
* by applying the transformation immediately instead of deferring it through
|
|
23266
23540
|
* the effect pipeline.
|
|
23267
23541
|
*
|
|
23268
|
-
* **
|
|
23542
|
+
* **Details**
|
|
23543
|
+
*
|
|
23544
|
+
* Behavior:
|
|
23269
23545
|
*
|
|
23270
23546
|
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
23271
23547
|
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
@@ -23293,13 +23569,15 @@ export const mapEager: {
|
|
|
23293
23569
|
* An optimized version of `map` that checks if an effect is already resolved
|
|
23294
23570
|
* and applies the mapping function eagerly when possible.
|
|
23295
23571
|
*
|
|
23296
|
-
* **When to
|
|
23572
|
+
* **When to use**
|
|
23297
23573
|
*
|
|
23298
23574
|
* `mapEager` provides better performance for effects that are already resolved
|
|
23299
23575
|
* by applying the transformation immediately instead of deferring it through
|
|
23300
23576
|
* the effect pipeline.
|
|
23301
23577
|
*
|
|
23302
|
-
* **
|
|
23578
|
+
* **Details**
|
|
23579
|
+
*
|
|
23580
|
+
* Behavior:
|
|
23303
23581
|
*
|
|
23304
23582
|
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
23305
23583
|
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
@@ -23329,13 +23607,15 @@ export const mapEager: {
|
|
|
23329
23607
|
* An optimized version of `mapError` that checks if an effect is already resolved
|
|
23330
23608
|
* and applies the error mapping function eagerly when possible.
|
|
23331
23609
|
*
|
|
23332
|
-
* **When to
|
|
23610
|
+
* **When to use**
|
|
23333
23611
|
*
|
|
23334
23612
|
* `mapErrorEager` provides better performance for effects that are already resolved
|
|
23335
23613
|
* by applying the error transformation immediately instead of deferring it through
|
|
23336
23614
|
* the effect pipeline.
|
|
23337
23615
|
*
|
|
23338
|
-
* **
|
|
23616
|
+
* **Details**
|
|
23617
|
+
*
|
|
23618
|
+
* Behavior:
|
|
23339
23619
|
*
|
|
23340
23620
|
* - For **Success effects**: Returns the success as-is (no error to transform)
|
|
23341
23621
|
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
@@ -23366,13 +23646,15 @@ export const mapErrorEager: {
|
|
|
23366
23646
|
* An optimized version of `mapError` that checks if an effect is already resolved
|
|
23367
23647
|
* and applies the error mapping function eagerly when possible.
|
|
23368
23648
|
*
|
|
23369
|
-
* **When to
|
|
23649
|
+
* **When to use**
|
|
23370
23650
|
*
|
|
23371
23651
|
* `mapErrorEager` provides better performance for effects that are already resolved
|
|
23372
23652
|
* by applying the error transformation immediately instead of deferring it through
|
|
23373
23653
|
* the effect pipeline.
|
|
23374
23654
|
*
|
|
23375
|
-
* **
|
|
23655
|
+
* **Details**
|
|
23656
|
+
*
|
|
23657
|
+
* Behavior:
|
|
23376
23658
|
*
|
|
23377
23659
|
* - For **Success effects**: Returns the success as-is (no error to transform)
|
|
23378
23660
|
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
@@ -23403,13 +23685,15 @@ export const mapErrorEager: {
|
|
|
23403
23685
|
* An optimized version of `mapError` that checks if an effect is already resolved
|
|
23404
23686
|
* and applies the error mapping function eagerly when possible.
|
|
23405
23687
|
*
|
|
23406
|
-
* **When to
|
|
23688
|
+
* **When to use**
|
|
23407
23689
|
*
|
|
23408
23690
|
* `mapErrorEager` provides better performance for effects that are already resolved
|
|
23409
23691
|
* by applying the error transformation immediately instead of deferring it through
|
|
23410
23692
|
* the effect pipeline.
|
|
23411
23693
|
*
|
|
23412
|
-
* **
|
|
23694
|
+
* **Details**
|
|
23695
|
+
*
|
|
23696
|
+
* Behavior:
|
|
23413
23697
|
*
|
|
23414
23698
|
* - For **Success effects**: Returns the success as-is (no error to transform)
|
|
23415
23699
|
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
@@ -23442,13 +23726,15 @@ export const mapErrorEager: {
|
|
|
23442
23726
|
* An optimized version of `mapBoth` that checks if an effect is already resolved
|
|
23443
23727
|
* and applies the appropriate mapping function eagerly when possible.
|
|
23444
23728
|
*
|
|
23445
|
-
* **When to
|
|
23729
|
+
* **When to use**
|
|
23446
23730
|
*
|
|
23447
23731
|
* `mapBothEager` provides better performance for effects that are already resolved
|
|
23448
23732
|
* by applying the transformation immediately instead of deferring it through
|
|
23449
23733
|
* the effect pipeline.
|
|
23450
23734
|
*
|
|
23451
|
-
* **
|
|
23735
|
+
* **Details**
|
|
23736
|
+
*
|
|
23737
|
+
* Behavior:
|
|
23452
23738
|
*
|
|
23453
23739
|
* - For **Success effects**: Applies the `onSuccess` function immediately to the value
|
|
23454
23740
|
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
@@ -23481,13 +23767,15 @@ export const mapBothEager: {
|
|
|
23481
23767
|
* An optimized version of `mapBoth` that checks if an effect is already resolved
|
|
23482
23768
|
* and applies the appropriate mapping function eagerly when possible.
|
|
23483
23769
|
*
|
|
23484
|
-
* **When to
|
|
23770
|
+
* **When to use**
|
|
23485
23771
|
*
|
|
23486
23772
|
* `mapBothEager` provides better performance for effects that are already resolved
|
|
23487
23773
|
* by applying the transformation immediately instead of deferring it through
|
|
23488
23774
|
* the effect pipeline.
|
|
23489
23775
|
*
|
|
23490
|
-
* **
|
|
23776
|
+
* **Details**
|
|
23777
|
+
*
|
|
23778
|
+
* Behavior:
|
|
23491
23779
|
*
|
|
23492
23780
|
* - For **Success effects**: Applies the `onSuccess` function immediately to the value
|
|
23493
23781
|
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
@@ -23522,13 +23810,15 @@ export const mapBothEager: {
|
|
|
23522
23810
|
* An optimized version of `mapBoth` that checks if an effect is already resolved
|
|
23523
23811
|
* and applies the appropriate mapping function eagerly when possible.
|
|
23524
23812
|
*
|
|
23525
|
-
* **When to
|
|
23813
|
+
* **When to use**
|
|
23526
23814
|
*
|
|
23527
23815
|
* `mapBothEager` provides better performance for effects that are already resolved
|
|
23528
23816
|
* by applying the transformation immediately instead of deferring it through
|
|
23529
23817
|
* the effect pipeline.
|
|
23530
23818
|
*
|
|
23531
|
-
* **
|
|
23819
|
+
* **Details**
|
|
23820
|
+
*
|
|
23821
|
+
* Behavior:
|
|
23532
23822
|
*
|
|
23533
23823
|
* - For **Success effects**: Applies the `onSuccess` function immediately to the value
|
|
23534
23824
|
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
@@ -23566,13 +23856,15 @@ export const mapBothEager: {
|
|
|
23566
23856
|
* An optimized version of `flatMap` that checks if an effect is already resolved
|
|
23567
23857
|
* and applies the flatMap function eagerly when possible.
|
|
23568
23858
|
*
|
|
23569
|
-
* **When to
|
|
23859
|
+
* **When to use**
|
|
23570
23860
|
*
|
|
23571
23861
|
* `flatMapEager` provides better performance for effects that are already resolved
|
|
23572
23862
|
* by applying the transformation immediately instead of deferring it through
|
|
23573
23863
|
* the effect pipeline.
|
|
23574
23864
|
*
|
|
23575
|
-
* **
|
|
23865
|
+
* **Details**
|
|
23866
|
+
*
|
|
23867
|
+
* Behavior:
|
|
23576
23868
|
*
|
|
23577
23869
|
* - For **Success effects**: Applies the flatMap function immediately to the value
|
|
23578
23870
|
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
@@ -23603,13 +23895,15 @@ export const flatMapEager: {
|
|
|
23603
23895
|
* An optimized version of `flatMap` that checks if an effect is already resolved
|
|
23604
23896
|
* and applies the flatMap function eagerly when possible.
|
|
23605
23897
|
*
|
|
23606
|
-
* **When to
|
|
23898
|
+
* **When to use**
|
|
23607
23899
|
*
|
|
23608
23900
|
* `flatMapEager` provides better performance for effects that are already resolved
|
|
23609
23901
|
* by applying the transformation immediately instead of deferring it through
|
|
23610
23902
|
* the effect pipeline.
|
|
23611
23903
|
*
|
|
23612
|
-
* **
|
|
23904
|
+
* **Details**
|
|
23905
|
+
*
|
|
23906
|
+
* Behavior:
|
|
23613
23907
|
*
|
|
23614
23908
|
* - For **Success effects**: Applies the flatMap function immediately to the value
|
|
23615
23909
|
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
@@ -23640,13 +23934,15 @@ export const flatMapEager: {
|
|
|
23640
23934
|
* An optimized version of `flatMap` that checks if an effect is already resolved
|
|
23641
23935
|
* and applies the flatMap function eagerly when possible.
|
|
23642
23936
|
*
|
|
23643
|
-
* **When to
|
|
23937
|
+
* **When to use**
|
|
23644
23938
|
*
|
|
23645
23939
|
* `flatMapEager` provides better performance for effects that are already resolved
|
|
23646
23940
|
* by applying the transformation immediately instead of deferring it through
|
|
23647
23941
|
* the effect pipeline.
|
|
23648
23942
|
*
|
|
23649
|
-
* **
|
|
23943
|
+
* **Details**
|
|
23944
|
+
*
|
|
23945
|
+
* Behavior:
|
|
23650
23946
|
*
|
|
23651
23947
|
* - For **Success effects**: Applies the flatMap function immediately to the value
|
|
23652
23948
|
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
@@ -23679,13 +23975,15 @@ export const flatMapEager: {
|
|
|
23679
23975
|
* An optimized version of `catch` that checks if an effect is already resolved
|
|
23680
23976
|
* and applies the catch function eagerly when possible.
|
|
23681
23977
|
*
|
|
23682
|
-
* **When to
|
|
23978
|
+
* **When to use**
|
|
23683
23979
|
*
|
|
23684
23980
|
* `catchEager` provides better performance for effects that are already resolved
|
|
23685
23981
|
* by applying the error recovery immediately instead of deferring it through
|
|
23686
23982
|
* the effect pipeline.
|
|
23687
23983
|
*
|
|
23688
|
-
* **
|
|
23984
|
+
* **Details**
|
|
23985
|
+
*
|
|
23986
|
+
* Behavior:
|
|
23689
23987
|
*
|
|
23690
23988
|
* - For **Success effects**: Returns the success as-is (no error to catch)
|
|
23691
23989
|
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
@@ -23726,13 +24024,15 @@ export const catchEager: {
|
|
|
23726
24024
|
* An optimized version of `catch` that checks if an effect is already resolved
|
|
23727
24025
|
* and applies the catch function eagerly when possible.
|
|
23728
24026
|
*
|
|
23729
|
-
* **When to
|
|
24027
|
+
* **When to use**
|
|
23730
24028
|
*
|
|
23731
24029
|
* `catchEager` provides better performance for effects that are already resolved
|
|
23732
24030
|
* by applying the error recovery immediately instead of deferring it through
|
|
23733
24031
|
* the effect pipeline.
|
|
23734
24032
|
*
|
|
23735
|
-
* **
|
|
24033
|
+
* **Details**
|
|
24034
|
+
*
|
|
24035
|
+
* Behavior:
|
|
23736
24036
|
*
|
|
23737
24037
|
* - For **Success effects**: Returns the success as-is (no error to catch)
|
|
23738
24038
|
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
@@ -23773,13 +24073,15 @@ export const catchEager: {
|
|
|
23773
24073
|
* An optimized version of `catch` that checks if an effect is already resolved
|
|
23774
24074
|
* and applies the catch function eagerly when possible.
|
|
23775
24075
|
*
|
|
23776
|
-
* **When to
|
|
24076
|
+
* **When to use**
|
|
23777
24077
|
*
|
|
23778
24078
|
* `catchEager` provides better performance for effects that are already resolved
|
|
23779
24079
|
* by applying the error recovery immediately instead of deferring it through
|
|
23780
24080
|
* the effect pipeline.
|
|
23781
24081
|
*
|
|
23782
|
-
* **
|
|
24082
|
+
* **Details**
|
|
24083
|
+
*
|
|
24084
|
+
* Behavior:
|
|
23783
24085
|
*
|
|
23784
24086
|
* - For **Success effects**: Returns the success as-is (no error to catch)
|
|
23785
24087
|
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
@@ -23821,6 +24123,8 @@ export const catchEager: {
|
|
|
23821
24123
|
/**
|
|
23822
24124
|
* Creates untraced function effects with eager evaluation optimization.
|
|
23823
24125
|
*
|
|
24126
|
+
* **Details**
|
|
24127
|
+
*
|
|
23824
24128
|
* Executes generator functions eagerly when all yielded effects are synchronous,
|
|
23825
24129
|
* stopping at the first async effect and deferring to normal execution.
|
|
23826
24130
|
*
|