effect 4.0.0-beta.70 → 4.0.0-beta.72
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 +1483 -239
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +617 -164
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +646 -52
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +331 -28
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +474 -18
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +292 -14
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +239 -19
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +163 -13
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +53 -8
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +82 -11
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +73 -12
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +53 -15
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +488 -200
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +349 -129
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +539 -158
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +222 -89
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +81 -6
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -4
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +179 -54
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +65 -22
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +60 -3
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +31 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +21 -21
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +14 -18
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +135 -50
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +109 -37
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +52 -29
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +21 -21
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +32 -7
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +32 -7
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +503 -48
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +191 -17
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +116 -6
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +92 -6
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +30 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +30 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +92 -47
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +16 -12
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +313 -128
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +167 -68
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +345 -79
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +131 -12
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +5 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +203 -50
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +112 -32
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2006 -810
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +785 -350
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +16 -2
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +16 -2
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +100 -8
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +141 -8
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +10 -11
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +7 -8
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +46 -43
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +43 -35
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +135 -16
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +93 -12
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +96 -26
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +28 -2
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +149 -101
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +117 -80
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +321 -72
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +152 -3
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +6 -6
- package/dist/FiberHandle.js +4 -4
- package/dist/FiberMap.d.ts +18 -18
- package/dist/FiberMap.js +8 -8
- package/dist/FiberSet.d.ts +21 -13
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +17 -9
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +79 -16
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +93 -33
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +221 -2
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +155 -2
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +4 -6
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -5
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +164 -18
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +116 -15
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +297 -25
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +75 -12
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +59 -26
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +95 -19
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +119 -17
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +35 -37
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +13 -15
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +210 -9
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +95 -5
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +16 -16
- package/dist/HashSet.js +6 -6
- package/dist/Inspectable.d.ts +47 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +74 -17
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +261 -81
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +123 -43
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +34 -19
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +52 -44
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -5
- package/dist/JsonPointer.js +5 -5
- package/dist/JsonSchema.d.ts +77 -33
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +45 -31
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +158 -13
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +79 -4
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +297 -101
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +94 -36
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +9 -2
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +1 -2
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +96 -21
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +68 -9
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +21 -7
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +26 -13
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +82 -10
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +33 -2
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +215 -42
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +242 -59
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +68 -41
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +60 -33
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +285 -40
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +128 -7
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +111 -4
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +98 -39
- 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 +23 -5
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +141 -4
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +73 -2
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +20 -11
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -6
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +22 -6
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +6 -1
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +434 -17
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +268 -13
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +26 -33
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +18 -25
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +186 -150
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +75 -72
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +93 -120
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +149 -142
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +37 -5
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +22 -3
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +238 -15
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +106 -8
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +34 -6
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +19 -5
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +29 -4
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +16 -4
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +53 -4
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +45 -4
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +140 -14
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +63 -8
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +98 -168
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +109 -120
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +75 -9
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +70 -9
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +241 -66
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +187 -52
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +148 -3
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +69 -2
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +167 -59
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +163 -55
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +71 -16
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +171 -9
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +49 -3
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +73 -18
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +23 -3
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +174 -53
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +128 -23
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +27 -23
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +22 -18
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +82 -4
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +64 -4
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +17 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -4
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +168 -32
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +135 -30
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +226 -30
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +162 -23
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +15 -2
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +49 -3
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +218 -35
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +57 -10
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +213 -29
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +99 -11
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +62 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +52 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +380 -57
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +176 -32
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +124 -14
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +150 -25
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +436 -115
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +344 -107
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +53 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +42 -3
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +934 -239
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +655 -217
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +239 -28
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +239 -28
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +127 -129
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +115 -117
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +45 -56
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +39 -50
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +254 -15
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +295 -33
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +101 -71
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +92 -56
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +86 -50
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +9 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +38 -11
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +127 -25
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +91 -21
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +364 -19
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +155 -7
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +69 -7
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +49 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +348 -29
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +103 -8
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +343 -45
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +194 -26
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +72 -17
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +62 -16
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +774 -224
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +333 -91
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +219 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +179 -29
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +54 -110
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +26 -42
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +341 -105
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +162 -44
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +25 -7
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +25 -7
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +529 -29
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +193 -11
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +36 -13
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +5 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +76 -20
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +41 -5
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +74 -7
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +74 -7
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +67 -30
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +7 -7
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +96 -108
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -52
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +42 -9
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +42 -9
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +85 -2
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +56 -2
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +20 -20
- package/dist/TxHashMap.js +8 -8
- package/dist/TxHashSet.d.ts +14 -14
- package/dist/TxHashSet.js +6 -6
- package/dist/TxPriorityQueue.d.ts +43 -8
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +41 -6
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +98 -8
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +70 -8
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +58 -17
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +10 -10
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +88 -16
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +78 -14
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +113 -8
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +82 -8
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +173 -14
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +130 -14
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +206 -3
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +111 -3
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +68 -13
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +171 -30
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +115 -30
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +130 -22
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +36 -12
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +21 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +14 -6
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -5205
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5205
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/request.js +3 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +11 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/representation.js +21 -12
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +69 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +73 -9
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +79 -30
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +69 -31
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -107
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -107
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +33 -5
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +33 -5
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +9 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +43 -11
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +45 -6
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +73 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +104 -8
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +103 -7
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +8 -3
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +8 -3
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +51 -7
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +50 -6
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +299 -169
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +278 -147
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +108 -14
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +80 -10
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +35 -13
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +34 -12
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +48 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +24 -3
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +23 -2
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +71 -13
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +35 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +34 -12
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +33 -11
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +40 -27
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +34 -26
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +41 -25
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +41 -25
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +85 -24
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +84 -23
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +1 -1
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +0 -560
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +0 -560
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +3 -3
- package/dist/unstable/cli/CliError.js +3 -3
- package/dist/unstable/cli/CliOutput.d.ts +1 -1
- package/dist/unstable/cli/Command.d.ts +136 -8
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +50 -4
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +13 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.js +41 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +24 -12
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +18 -6
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +39 -8
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +39 -8
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +128 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +59 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +3 -3
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +59 -10
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +37 -7
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +51 -9
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +0 -220
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +0 -220
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +61 -22
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +61 -22
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +58 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +58 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +87 -26
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +87 -26
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +49 -10
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +6 -1
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +6 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +33 -6
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +32 -5
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +19 -0
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +19 -0
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +44 -7
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +44 -7
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +5 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +4 -5
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +19 -0
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +19 -0
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +11 -11
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +11 -11
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +42 -22
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +42 -22
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +33 -14
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +35 -9
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +35 -9
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +11 -11
- package/dist/unstable/cluster/Message.js +11 -11
- package/dist/unstable/cluster/MessageStorage.d.ts +38 -24
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +37 -23
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +18 -8
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +18 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -14
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -14
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +52 -10
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +52 -10
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +33 -16
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +33 -16
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +19 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +19 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +25 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +24 -0
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +24 -2
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +24 -2
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +27 -3
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +63 -20
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +60 -16
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +61 -17
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -14
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -15
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +26 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +26 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +51 -9
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +51 -9
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +27 -13
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +27 -13
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +19 -5
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +19 -5
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +27 -1
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +27 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +38 -0
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +73 -13
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +25 -14
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +25 -14
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +0 -790
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +0 -790
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +41 -11
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +41 -11
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +38 -0
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +68 -11
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +24 -16
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +20 -13
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +20 -13
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +0 -58
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +0 -58
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +30 -14
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +28 -14
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +28 -14
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +38 -17
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +3 -3
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +0 -49
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +0 -49
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +28 -13
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +23 -15
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +22 -14
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +7 -7
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +36 -19
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +63 -25
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +61 -23
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +49 -40
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +28 -28
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +14 -4
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +14 -4
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +7 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +7 -2
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +82 -7
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +119 -22
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +33 -7
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +68 -24
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +21 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +50 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +30 -11
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +0 -240
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +0 -240
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +99 -52
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +77 -30
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +43 -13
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +43 -13
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +59 -17
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +59 -17
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +60 -22
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +58 -20
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +6 -2
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +59 -15
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +66 -30
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +17 -7
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +15 -14
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +39 -22
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +37 -16
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +37 -16
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +35 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +33 -14
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +3 -3
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +3 -3
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +46 -20
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +46 -20
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +19 -14
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +54 -26
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +34 -21
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +34 -21
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +41 -28
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +39 -26
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +53 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +20 -5
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +28 -14
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +64 -42
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +48 -26
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +30 -13
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +29 -12
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +32 -19
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +32 -19
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +39 -19
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +39 -19
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +27 -14
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +25 -12
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +41 -28
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +32 -17
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +43 -28
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +40 -25
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +0 -452
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +0 -452
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +50 -26
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +39 -25
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +28 -16
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +51 -23
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +37 -17
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +34 -23
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +4 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +28 -16
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +43 -43
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +42 -42
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +28 -16
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +7 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +45 -27
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +0 -311
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +0 -311
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +31 -16
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +31 -15
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +33 -15
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +27 -16
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +27 -16
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.js +3 -3
- package/dist/unstable/observability/index.d.ts +0 -183
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +0 -183
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +12 -4
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +10 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -3
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +8 -3
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +29 -16
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +27 -14
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +10 -5
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -4
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +20 -10
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +19 -9
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +33 -15
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +0 -147
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +0 -147
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +14 -14
- package/dist/unstable/process/ChildProcess.js +7 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts +17 -5
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +17 -5
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +0 -45
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +0 -45
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +74 -22
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +52 -20
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +81 -35
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +70 -32
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +32 -16
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +52 -25
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +81 -20
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +81 -20
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +37 -17
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +44 -21
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +44 -21
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +0 -166
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +0 -166
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +47 -32
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +15 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +27 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +27 -12
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +31 -17
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +31 -17
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +29 -18
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +37 -19
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +4 -4
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +31 -21
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +31 -21
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +30 -20
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +30 -20
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +50 -33
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +48 -31
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +22 -17
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +22 -17
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +31 -15
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +31 -15
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +29 -14
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +0 -272
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +0 -272
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +32 -33
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +25 -26
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -1
- package/dist/unstable/schema/index.d.ts +0 -37
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +0 -37
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +8 -2
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +8 -2
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +2 -2
- package/dist/unstable/socket/SocketServer.js +1 -1
- package/dist/unstable/socket/index.d.ts +0 -44
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +0 -44
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +39 -18
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +7 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +1 -1
- package/dist/unstable/sql/SqlConnection.js +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +33 -17
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +3 -3
- package/dist/unstable/sql/SqlResolver.js +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +51 -21
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +51 -21
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +34 -14
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +0 -178
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +0 -178
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +32 -21
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +32 -21
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +37 -24
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +35 -22
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +32 -16
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +31 -20
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +31 -20
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +0 -80
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +0 -80
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +2 -2
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +25 -13
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +12 -12
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableQueue.d.ts +36 -18
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +36 -18
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +22 -23
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +17 -18
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +26 -8
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +25 -7
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +0 -160
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +0 -160
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +1557 -312
- package/src/BigDecimal.ts +646 -52
- package/src/BigInt.ts +474 -18
- package/src/Boolean.ts +239 -19
- package/src/Brand.ts +102 -11
- package/src/Cache.ts +96 -24
- package/src/Cause.ts +488 -200
- package/src/Channel.ts +647 -191
- package/src/ChannelSchema.ts +99 -6
- package/src/Chunk.ts +187 -54
- package/src/Clock.ts +60 -3
- package/src/Combiner.ts +21 -21
- package/src/Config.ts +135 -50
- package/src/ConfigProvider.ts +52 -29
- package/src/Console.ts +32 -7
- package/src/Context.ts +516 -50
- package/src/Cron.ts +116 -6
- package/src/Crypto.ts +30 -1
- package/src/Data.ts +92 -47
- package/src/DateTime.ts +313 -128
- package/src/Deferred.ts +345 -79
- package/src/Differ.ts +5 -0
- package/src/Duration.ts +203 -50
- package/src/Effect.ts +2044 -816
- package/src/Effectable.ts +16 -2
- package/src/Encoding.ts +146 -9
- package/src/Equal.ts +10 -11
- package/src/Equivalence.ts +49 -46
- package/src/ErrorReporter.ts +135 -16
- package/src/ExecutionPlan.ts +96 -26
- package/src/Exit.ts +149 -101
- package/src/Fiber.ts +321 -72
- package/src/FiberHandle.ts +6 -6
- package/src/FiberMap.ts +20 -20
- package/src/FiberSet.ts +21 -13
- package/src/FileSystem.ts +119 -39
- package/src/Filter.ts +221 -2
- package/src/Formatter.ts +4 -6
- package/src/Function.ts +164 -18
- package/src/Graph.ts +297 -25
- package/src/HKT.ts +59 -26
- package/src/Hash.ts +143 -23
- package/src/HashMap.ts +35 -37
- package/src/HashRing.ts +210 -9
- package/src/HashSet.ts +16 -16
- package/src/Inspectable.ts +86 -17
- package/src/Iterable.ts +261 -81
- package/src/JsonPatch.ts +79 -56
- package/src/JsonPointer.ts +5 -5
- package/src/JsonSchema.ts +77 -33
- package/src/Latch.ts +164 -13
- package/src/Layer.ts +297 -101
- package/src/LayerMap.ts +9 -2
- package/src/LogLevel.ts +96 -21
- package/src/Logger.ts +31 -15
- package/src/ManagedRuntime.ts +82 -10
- package/src/Match.ts +250 -59
- package/src/Metric.ts +68 -41
- package/src/MutableHashMap.ts +381 -52
- package/src/MutableHashSet.ts +145 -41
- package/src/MutableList.ts +24 -6
- package/src/MutableRef.ts +141 -4
- package/src/Newtype.ts +20 -11
- package/src/NonEmptyIterable.ts +22 -6
- package/src/Number.ts +434 -17
- package/src/Optic.ts +26 -33
- package/src/Option.ts +186 -150
- package/src/Order.ts +163 -161
- package/src/Ordering.ts +37 -5
- package/src/PartitionedSemaphore.ts +238 -15
- package/src/Path.ts +34 -6
- package/src/Pipeable.ts +29 -4
- package/src/PlatformError.ts +53 -4
- package/src/Pool.ts +174 -32
- package/src/Predicate.ts +151 -196
- package/src/PrimaryKey.ts +75 -9
- package/src/PubSub.ts +241 -66
- package/src/Pull.ts +148 -3
- package/src/Queue.ts +167 -59
- package/src/Random.ts +71 -16
- package/src/RcMap.ts +171 -9
- package/src/RcRef.ts +73 -18
- package/src/Record.ts +174 -53
- package/src/Redactable.ts +27 -23
- package/src/Redacted.ts +82 -4
- package/src/Reducer.ts +17 -7
- package/src/Ref.ts +332 -54
- package/src/References.ts +226 -30
- package/src/RegExp.ts +49 -3
- package/src/Request.ts +218 -35
- package/src/RequestResolver.ts +268 -36
- package/src/Resource.ts +62 -3
- package/src/Result.ts +380 -57
- package/src/Runtime.ts +172 -32
- package/src/Schedule.ts +510 -145
- package/src/Scheduler.ts +53 -4
- package/src/Schema.ts +975 -264
- package/src/SchemaAST.ts +239 -28
- package/src/SchemaGetter.ts +127 -129
- package/src/SchemaIssue.ts +45 -56
- package/src/SchemaParser.ts +295 -33
- package/src/SchemaRepresentation.ts +106 -77
- package/src/SchemaTransformation.ts +92 -56
- package/src/SchemaUtils.ts +38 -11
- package/src/Scope.ts +127 -25
- package/src/ScopedCache.ts +418 -21
- package/src/ScopedRef.ts +69 -7
- package/src/Semaphore.ts +348 -29
- package/src/Sink.ts +343 -45
- package/src/Stdio.ts +72 -17
- package/src/Stream.ts +880 -242
- package/src/String.ts +221 -49
- package/src/Struct.ts +54 -110
- package/src/SubscriptionRef.ts +341 -105
- package/src/Symbol.ts +25 -7
- package/src/SynchronizedRef.ts +529 -29
- package/src/Take.ts +36 -13
- package/src/Terminal.ts +76 -20
- package/src/Tracer.ts +74 -7
- package/src/Trie.ts +67 -30
- package/src/Tuple.ts +96 -108
- package/src/TxChunk.ts +42 -9
- package/src/TxDeferred.ts +85 -2
- package/src/TxHashMap.ts +22 -22
- package/src/TxHashSet.ts +22 -22
- package/src/TxPriorityQueue.ts +43 -8
- package/src/TxPubSub.ts +98 -8
- package/src/TxQueue.ts +58 -17
- package/src/TxReentrantLock.ts +88 -16
- package/src/TxRef.ts +113 -8
- package/src/TxSemaphore.ts +173 -14
- package/src/TxSubscriptionRef.ts +206 -3
- package/src/Types.ts +68 -13
- package/src/UndefinedOr.ts +171 -30
- package/src/Unify.ts +130 -22
- package/src/Utils.ts +21 -16
- package/src/index.ts +0 -5205
- package/src/internal/effect.ts +59 -29
- package/src/internal/request.ts +3 -1
- package/src/internal/schema/arbitrary.ts +14 -1
- package/src/internal/schema/representation.ts +37 -14
- package/src/testing/TestConsole.ts +105 -9
- package/src/testing/TestSchema.ts +81 -31
- package/src/testing/index.ts +0 -107
- package/src/unstable/ai/AiError.ts +33 -5
- package/src/unstable/ai/AnthropicStructuredOutput.ts +43 -11
- package/src/unstable/ai/Chat.ts +82 -33
- package/src/unstable/ai/EmbeddingModel.ts +104 -8
- package/src/unstable/ai/IdGenerator.ts +8 -3
- package/src/unstable/ai/LanguageModel.ts +51 -7
- package/src/unstable/ai/McpSchema.ts +299 -169
- package/src/unstable/ai/McpServer.ts +108 -14
- package/src/unstable/ai/Model.ts +35 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +48 -1
- package/src/unstable/ai/Prompt.ts +24 -3
- package/src/unstable/ai/Response.ts +71 -13
- package/src/unstable/ai/ResponseIdTracker.ts +34 -12
- package/src/unstable/ai/Telemetry.ts +40 -27
- package/src/unstable/ai/Tokenizer.ts +41 -25
- package/src/unstable/ai/Tool.ts +85 -24
- package/src/unstable/ai/Toolkit.ts +32 -4
- package/src/unstable/ai/index.ts +0 -560
- package/src/unstable/cli/Argument.ts +1 -1
- package/src/unstable/cli/CliError.ts +3 -3
- package/src/unstable/cli/CliOutput.ts +1 -1
- package/src/unstable/cli/Command.ts +136 -8
- package/src/unstable/cli/Completions.ts +41 -1
- package/src/unstable/cli/Flag.ts +24 -12
- package/src/unstable/cli/GlobalFlag.ts +39 -8
- package/src/unstable/cli/Param.ts +137 -11
- package/src/unstable/cli/Primitive.ts +59 -10
- package/src/unstable/cli/Prompt.ts +63 -14
- package/src/unstable/cli/index.ts +0 -220
- package/src/unstable/cli/internal/parser.ts +1 -1
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterError.ts +61 -22
- package/src/unstable/cluster/ClusterMetrics.ts +58 -5
- package/src/unstable/cluster/ClusterSchema.ts +87 -26
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +63 -11
- package/src/unstable/cluster/DeliverAt.ts +6 -1
- package/src/unstable/cluster/Entity.ts +33 -6
- package/src/unstable/cluster/EntityAddress.ts +19 -0
- package/src/unstable/cluster/EntityId.ts +44 -7
- package/src/unstable/cluster/EntityResource.ts +5 -6
- package/src/unstable/cluster/EntityType.ts +19 -0
- package/src/unstable/cluster/Envelope.ts +11 -11
- package/src/unstable/cluster/HttpRunner.ts +42 -22
- package/src/unstable/cluster/K8sHttpClient.ts +32 -13
- package/src/unstable/cluster/MachineId.ts +35 -9
- package/src/unstable/cluster/Message.ts +11 -11
- package/src/unstable/cluster/MessageStorage.ts +38 -24
- package/src/unstable/cluster/Reply.ts +18 -8
- package/src/unstable/cluster/Runner.ts +47 -14
- package/src/unstable/cluster/RunnerAddress.ts +52 -10
- package/src/unstable/cluster/RunnerHealth.ts +33 -16
- package/src/unstable/cluster/RunnerServer.ts +19 -4
- package/src/unstable/cluster/Runners.ts +25 -1
- package/src/unstable/cluster/ShardId.ts +24 -2
- package/src/unstable/cluster/Sharding.ts +63 -20
- package/src/unstable/cluster/ShardingConfig.ts +60 -16
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +27 -14
- package/src/unstable/cluster/SingleRunner.ts +26 -1
- package/src/unstable/cluster/Singleton.ts +51 -9
- package/src/unstable/cluster/SingletonAddress.ts +27 -13
- package/src/unstable/cluster/Snowflake.ts +19 -5
- package/src/unstable/cluster/SocketRunner.ts +27 -1
- package/src/unstable/cluster/SqlMessageStorage.ts +73 -13
- package/src/unstable/cluster/SqlRunnerStorage.ts +20 -0
- package/src/unstable/cluster/TestRunner.ts +25 -14
- package/src/unstable/cluster/index.ts +0 -790
- package/src/unstable/devtools/DevTools.ts +41 -11
- package/src/unstable/devtools/DevToolsClient.ts +68 -11
- package/src/unstable/devtools/DevToolsSchema.ts +24 -16
- package/src/unstable/devtools/DevToolsServer.ts +18 -11
- package/src/unstable/devtools/index.ts +0 -58
- package/src/unstable/encoding/Msgpack.ts +30 -14
- package/src/unstable/encoding/Ndjson.ts +28 -14
- package/src/unstable/encoding/Sse.ts +38 -17
- package/src/unstable/encoding/index.ts +0 -49
- package/src/unstable/eventlog/Event.ts +30 -15
- package/src/unstable/eventlog/EventGroup.ts +23 -15
- package/src/unstable/eventlog/EventJournal.ts +38 -21
- package/src/unstable/eventlog/EventLog.ts +63 -25
- package/src/unstable/eventlog/EventLogEncryption.ts +8 -3
- package/src/unstable/eventlog/EventLogMessage.ts +49 -40
- package/src/unstable/eventlog/EventLogRemote.ts +14 -4
- package/src/unstable/eventlog/EventLogServer.ts +36 -17
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +24 -2
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +119 -22
- package/src/unstable/eventlog/EventLogSessionAuth.ts +68 -24
- package/src/unstable/eventlog/SqlEventJournal.ts +50 -14
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +39 -15
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +30 -11
- package/src/unstable/eventlog/index.ts +0 -240
- package/src/unstable/http/Cookies.ts +97 -50
- package/src/unstable/http/Etag.ts +43 -13
- package/src/unstable/http/FetchHttpClient.ts +59 -17
- package/src/unstable/http/Headers.ts +62 -24
- package/src/unstable/http/HttpBody.ts +59 -15
- package/src/unstable/http/HttpClient.ts +119 -33
- package/src/unstable/http/HttpClientError.ts +41 -24
- package/src/unstable/http/HttpClientRequest.ts +37 -16
- package/src/unstable/http/HttpClientResponse.ts +33 -14
- package/src/unstable/http/HttpEffect.ts +35 -18
- package/src/unstable/http/HttpMethod.ts +46 -20
- package/src/unstable/http/HttpRouter.ts +58 -30
- package/src/unstable/http/HttpServer.ts +34 -21
- package/src/unstable/http/HttpServerError.ts +41 -28
- package/src/unstable/http/HttpServerRequest.ts +51 -19
- package/src/unstable/http/HttpServerRespondable.ts +28 -14
- package/src/unstable/http/HttpServerResponse.ts +66 -44
- package/src/unstable/http/HttpStaticServer.ts +29 -12
- package/src/unstable/http/HttpTraceContext.ts +32 -19
- package/src/unstable/http/Multipart.ts +39 -19
- package/src/unstable/http/Template.ts +25 -12
- package/src/unstable/http/Url.ts +41 -28
- package/src/unstable/http/UrlParams.ts +43 -28
- package/src/unstable/http/index.ts +0 -452
- package/src/unstable/httpapi/HttpApi.ts +48 -24
- package/src/unstable/httpapi/HttpApiBuilder.ts +40 -26
- package/src/unstable/httpapi/HttpApiClient.ts +28 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +51 -23
- package/src/unstable/httpapi/HttpApiError.ts +38 -18
- package/src/unstable/httpapi/HttpApiGroup.ts +34 -23
- package/src/unstable/httpapi/HttpApiMiddleware.ts +49 -25
- package/src/unstable/httpapi/HttpApiScalar.ts +32 -17
- package/src/unstable/httpapi/HttpApiSchema.ts +43 -43
- package/src/unstable/httpapi/HttpApiSecurity.ts +54 -24
- package/src/unstable/httpapi/HttpApiSwagger.ts +28 -16
- package/src/unstable/httpapi/HttpApiTest.ts +1 -1
- package/src/unstable/httpapi/OpenApi.ts +43 -25
- package/src/unstable/httpapi/index.ts +0 -311
- package/src/unstable/observability/Otlp.ts +31 -16
- package/src/unstable/observability/OtlpLogger.ts +31 -15
- package/src/unstable/observability/OtlpResource.ts +33 -15
- package/src/unstable/observability/OtlpSerialization.ts +25 -14
- package/src/unstable/observability/PrometheusMetrics.ts +3 -3
- package/src/unstable/observability/index.ts +0 -183
- package/src/unstable/persistence/KeyValueStore.ts +12 -4
- package/src/unstable/persistence/Persistable.ts +8 -3
- package/src/unstable/persistence/PersistedCache.ts +27 -14
- package/src/unstable/persistence/PersistedQueue.ts +10 -5
- package/src/unstable/persistence/RateLimiter.ts +20 -10
- package/src/unstable/persistence/Redis.ts +33 -15
- package/src/unstable/persistence/index.ts +0 -147
- package/src/unstable/process/ChildProcess.ts +14 -14
- package/src/unstable/process/ChildProcessSpawner.ts +17 -5
- package/src/unstable/process/index.ts +0 -45
- package/src/unstable/reactivity/AsyncResult.ts +96 -24
- package/src/unstable/reactivity/Atom.ts +89 -35
- package/src/unstable/reactivity/AtomRef.ts +58 -25
- package/src/unstable/reactivity/AtomRegistry.ts +79 -18
- package/src/unstable/reactivity/Hydration.ts +37 -17
- package/src/unstable/reactivity/Reactivity.ts +42 -19
- package/src/unstable/reactivity/index.ts +0 -166
- package/src/unstable/rpc/Rpc.ts +47 -32
- package/src/unstable/rpc/RpcClient.ts +58 -34
- package/src/unstable/rpc/RpcClientError.ts +29 -15
- package/src/unstable/rpc/RpcGroup.ts +28 -17
- package/src/unstable/rpc/RpcMessage.ts +37 -19
- package/src/unstable/rpc/RpcMiddleware.ts +31 -21
- package/src/unstable/rpc/RpcSchema.ts +30 -20
- package/src/unstable/rpc/RpcSerialization.ts +48 -31
- package/src/unstable/rpc/RpcServer.ts +53 -40
- package/src/unstable/rpc/RpcTest.ts +29 -13
- package/src/unstable/rpc/RpcWorker.ts +29 -14
- package/src/unstable/rpc/index.ts +0 -272
- package/src/unstable/schema/Model.ts +32 -33
- package/src/unstable/schema/VariantSchema.ts +1 -1
- package/src/unstable/schema/index.ts +0 -37
- package/src/unstable/socket/Socket.ts +8 -2
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/socket/index.ts +0 -44
- package/src/unstable/sql/Migrator.ts +39 -18
- package/src/unstable/sql/SqlClient.ts +7 -2
- package/src/unstable/sql/SqlConnection.ts +1 -1
- package/src/unstable/sql/SqlError.ts +33 -17
- package/src/unstable/sql/SqlResolver.ts +3 -3
- package/src/unstable/sql/SqlSchema.ts +51 -21
- package/src/unstable/sql/Statement.ts +35 -15
- package/src/unstable/sql/index.ts +0 -178
- package/src/unstable/workers/Transferable.ts +32 -21
- package/src/unstable/workers/Worker.ts +35 -22
- package/src/unstable/workers/WorkerError.ts +35 -19
- package/src/unstable/workers/WorkerRunner.ts +29 -18
- package/src/unstable/workers/index.ts +0 -80
- package/src/unstable/workflow/DurableClock.ts +25 -13
- package/src/unstable/workflow/DurableDeferred.ts +12 -12
- package/src/unstable/workflow/DurableQueue.ts +34 -16
- package/src/unstable/workflow/Workflow.ts +22 -23
- package/src/unstable/workflow/WorkflowEngine.ts +26 -8
- package/src/unstable/workflow/index.ts +0 -160
package/dist/Effect.js
CHANGED
|
@@ -14,12 +14,12 @@ import { internalCall } from "./Utils.js";
|
|
|
14
14
|
/**
|
|
15
15
|
* Runtime identifier used to recognize `Effect` values.
|
|
16
16
|
*
|
|
17
|
-
* @category
|
|
17
|
+
* @category type IDs
|
|
18
18
|
* @since 4.0.0
|
|
19
19
|
*/
|
|
20
20
|
export const TypeId = core.EffectTypeId;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Checks whether a value is an `Effect`.
|
|
23
23
|
*
|
|
24
24
|
* **Example** (Checking whether a value is an Effect)
|
|
25
25
|
*
|
|
@@ -38,6 +38,11 @@ export const isEffect = core.isEffect;
|
|
|
38
38
|
* Combines an iterable or record of effects into one effect whose success shape
|
|
39
39
|
* follows the input.
|
|
40
40
|
*
|
|
41
|
+
* **When to use**
|
|
42
|
+
*
|
|
43
|
+
* Use to run a known collection of effects and collect results in the same
|
|
44
|
+
* tuple, iterable, or record shape.
|
|
45
|
+
*
|
|
41
46
|
* **Details**
|
|
42
47
|
*
|
|
43
48
|
* Tuple and iterable inputs collect results in order. Record inputs collect
|
|
@@ -159,7 +164,7 @@ export const isEffect = core.isEffect;
|
|
|
159
164
|
* ```
|
|
160
165
|
*
|
|
161
166
|
* @see {@link forEach} for iterating over elements and applying an effect.
|
|
162
|
-
* @category
|
|
167
|
+
* @category collecting
|
|
163
168
|
* @since 2.0.0
|
|
164
169
|
*/
|
|
165
170
|
export const all = internal.all;
|
|
@@ -190,7 +195,7 @@ export const all = internal.all;
|
|
|
190
195
|
* // [ ["0 is even", "2 is even"], [1, 3] ]
|
|
191
196
|
* ```
|
|
192
197
|
*
|
|
193
|
-
* @category
|
|
198
|
+
* @category collecting
|
|
194
199
|
* @since 2.0.0
|
|
195
200
|
*/
|
|
196
201
|
export const partition = internal.partition;
|
|
@@ -229,7 +234,7 @@ export const partition = internal.partition;
|
|
|
229
234
|
* // }
|
|
230
235
|
* ```
|
|
231
236
|
*
|
|
232
|
-
* @category
|
|
237
|
+
* @category error accumulation
|
|
233
238
|
* @since 2.0.0
|
|
234
239
|
*/
|
|
235
240
|
export const validate = internal.validate;
|
|
@@ -252,25 +257,37 @@ export const validate = internal.validate;
|
|
|
252
257
|
* // { _id: 'Option', _tag: 'Some', value: 3 }
|
|
253
258
|
* ```
|
|
254
259
|
*
|
|
255
|
-
* @category
|
|
260
|
+
* @category collecting
|
|
256
261
|
* @since 2.0.0
|
|
257
262
|
*/
|
|
258
263
|
export const findFirst = internal.findFirst;
|
|
259
264
|
/**
|
|
260
265
|
* Returns the first value that passes an effectful `FilterEffect`.
|
|
261
266
|
*
|
|
267
|
+
* **When to use**
|
|
268
|
+
*
|
|
269
|
+
* Use when you need to find the first element that satisfies an effectful
|
|
270
|
+
* filter returning a `Result`, which also transforms the matching element.
|
|
271
|
+
*
|
|
262
272
|
* **Details**
|
|
263
273
|
*
|
|
264
274
|
* The filter receives the element and index. Evaluation short-circuits on the
|
|
265
275
|
* first `Result.succeed` and returns the transformed value in `Option.some`.
|
|
266
276
|
*
|
|
267
|
-
* @
|
|
277
|
+
* @see {@link findFirst} for the simpler effectful predicate-based variant
|
|
278
|
+
*
|
|
279
|
+
* @category collecting
|
|
268
280
|
* @since 4.0.0
|
|
269
281
|
*/
|
|
270
282
|
export const findFirstFilter = internal.findFirstFilter;
|
|
271
283
|
/**
|
|
272
284
|
* Executes an effectful operation for each element in an `Iterable`.
|
|
273
285
|
*
|
|
286
|
+
* **When to use**
|
|
287
|
+
*
|
|
288
|
+
* Use to traverse an iterable with an effectful function while preserving
|
|
289
|
+
* element order in the collected results.
|
|
290
|
+
*
|
|
274
291
|
* **Details**
|
|
275
292
|
*
|
|
276
293
|
* The `forEach` function applies a provided operation to each element in the
|
|
@@ -334,7 +351,7 @@ export const findFirstFilter = internal.findFirstFilter;
|
|
|
334
351
|
* ```
|
|
335
352
|
*
|
|
336
353
|
* @see {@link all} for combining multiple effects into one.
|
|
337
|
-
* @category
|
|
354
|
+
* @category collecting
|
|
338
355
|
* @since 2.0.0
|
|
339
356
|
*/
|
|
340
357
|
export const forEach = internal.forEach;
|
|
@@ -363,7 +380,7 @@ export const forEach = internal.forEach;
|
|
|
363
380
|
* // Current count: 5
|
|
364
381
|
* ```
|
|
365
382
|
*
|
|
366
|
-
* @category
|
|
383
|
+
* @category collecting
|
|
367
384
|
* @since 2.0.0
|
|
368
385
|
*/
|
|
369
386
|
export const whileLoop = internal.whileLoop;
|
|
@@ -376,22 +393,21 @@ export const whileLoop = internal.whileLoop;
|
|
|
376
393
|
*
|
|
377
394
|
* **When to use**
|
|
378
395
|
*
|
|
379
|
-
* Use `
|
|
396
|
+
* Use to convert a `Promise` into an `Effect` when the async operation is
|
|
397
|
+
* guaranteed to succeed and will not reject.
|
|
380
398
|
*
|
|
381
399
|
* **Details**
|
|
382
400
|
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
401
|
+
* An optional `AbortSignal` can be provided to allow for interruption of the
|
|
402
|
+
* wrapped `Promise` API.
|
|
385
403
|
*
|
|
386
|
-
*
|
|
387
|
-
* was expected to be error-free. You can think of it similar to an unexpected
|
|
388
|
-
* crash in the program, which can be further managed or logged using tools like
|
|
389
|
-
* {@link catchDefect}.
|
|
404
|
+
* **Gotchas**
|
|
390
405
|
*
|
|
391
|
-
*
|
|
406
|
+
* The `Promise` must not reject. If it rejects, the rejection is treated as a
|
|
407
|
+
* defect, not as a typed failure. Use `tryPromise` when rejection is expected.
|
|
392
408
|
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
409
|
+
* Interruption aborts the provided `AbortSignal`, but the underlying
|
|
410
|
+
* asynchronous operation only stops if it observes that signal.
|
|
395
411
|
*
|
|
396
412
|
* **Example** (Wrapping a non-rejecting Promise)
|
|
397
413
|
*
|
|
@@ -414,7 +430,7 @@ export const whileLoop = internal.whileLoop;
|
|
|
414
430
|
* ```
|
|
415
431
|
*
|
|
416
432
|
* @see {@link tryPromise} for a version that can handle failures.
|
|
417
|
-
* @category
|
|
433
|
+
* @category creating effects
|
|
418
434
|
* @since 2.0.0
|
|
419
435
|
*/
|
|
420
436
|
export const promise = internal.promise;
|
|
@@ -424,11 +440,9 @@ export const promise = internal.promise;
|
|
|
424
440
|
*
|
|
425
441
|
* **When to use**
|
|
426
442
|
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
* throw exceptions by capturing those exceptions and transforming them into
|
|
431
|
-
* manageable errors.
|
|
443
|
+
* Use when you need to perform asynchronous operations that might fail, such
|
|
444
|
+
* as fetching data from an API, and want thrown exceptions or rejected promises
|
|
445
|
+
* captured as Effect errors.
|
|
432
446
|
*
|
|
433
447
|
* **Details**
|
|
434
448
|
*
|
|
@@ -482,7 +496,7 @@ export const promise = internal.promise;
|
|
|
482
496
|
* ```
|
|
483
497
|
*
|
|
484
498
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
485
|
-
* @category
|
|
499
|
+
* @category creating effects
|
|
486
500
|
* @since 2.0.0
|
|
487
501
|
*/
|
|
488
502
|
export const tryPromise = internal.tryPromise;
|
|
@@ -491,7 +505,7 @@ export const tryPromise = internal.tryPromise;
|
|
|
491
505
|
*
|
|
492
506
|
* **When to use**
|
|
493
507
|
*
|
|
494
|
-
* Use this function when you need an effect that completes successfully with a
|
|
508
|
+
* Use when you use this function when you need an effect that completes successfully with a
|
|
495
509
|
* specific value without any errors or external dependencies.
|
|
496
510
|
*
|
|
497
511
|
* **Example** (Creating a successful effect)
|
|
@@ -507,7 +521,7 @@ export const tryPromise = internal.tryPromise;
|
|
|
507
521
|
* ```
|
|
508
522
|
*
|
|
509
523
|
* @see {@link fail} to create an effect that represents a failure.
|
|
510
|
-
* @category
|
|
524
|
+
* @category creating effects
|
|
511
525
|
* @since 2.0.0
|
|
512
526
|
*/
|
|
513
527
|
export const succeed = internal.succeed;
|
|
@@ -525,7 +539,7 @@ export const succeed = internal.succeed;
|
|
|
525
539
|
* // Output: { _id: 'Option', _tag: 'None' }
|
|
526
540
|
* ```
|
|
527
541
|
*
|
|
528
|
-
* @category
|
|
542
|
+
* @category creating effects
|
|
529
543
|
* @since 2.0.0
|
|
530
544
|
*/
|
|
531
545
|
export const succeedNone = internal.succeedNone;
|
|
@@ -543,16 +557,16 @@ export const succeedNone = internal.succeedNone;
|
|
|
543
557
|
* // Output: { _id: 'Option', _tag: 'Some', value: 42 }
|
|
544
558
|
* ```
|
|
545
559
|
*
|
|
546
|
-
* @category
|
|
560
|
+
* @category creating effects
|
|
547
561
|
* @since 2.0.0
|
|
548
562
|
*/
|
|
549
563
|
export const succeedSome = internal.succeedSome;
|
|
550
564
|
/**
|
|
551
|
-
*
|
|
565
|
+
* Creates an `Effect` lazily, delaying construction until it is needed.
|
|
552
566
|
*
|
|
553
567
|
* **When to use**
|
|
554
568
|
*
|
|
555
|
-
* Use
|
|
569
|
+
* Use 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.
|
|
556
570
|
*
|
|
557
571
|
* **Details**
|
|
558
572
|
*
|
|
@@ -630,7 +644,7 @@ export const succeedSome = internal.succeedSome;
|
|
|
630
644
|
* )
|
|
631
645
|
* ```
|
|
632
646
|
*
|
|
633
|
-
* @category
|
|
647
|
+
* @category creating effects
|
|
634
648
|
* @since 2.0.0
|
|
635
649
|
*/
|
|
636
650
|
export const suspend = internal.suspend;
|
|
@@ -639,17 +653,16 @@ export const suspend = internal.suspend;
|
|
|
639
653
|
*
|
|
640
654
|
* **When to use**
|
|
641
655
|
*
|
|
642
|
-
* Use
|
|
656
|
+
* Use when you are sure the operation will not fail.
|
|
643
657
|
*
|
|
644
658
|
* **Details**
|
|
645
659
|
*
|
|
646
|
-
* The provided function
|
|
647
|
-
*
|
|
660
|
+
* The provided function is evaluated lazily when the effect runs.
|
|
661
|
+
*
|
|
662
|
+
* **Gotchas**
|
|
648
663
|
*
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
* crash in the program, which can be further managed or logged using tools like
|
|
652
|
-
* {@link catchDefect}.
|
|
664
|
+
* The function must not throw. If it throws, the thrown value is treated as a
|
|
665
|
+
* defect, not as a typed failure. Use `try` when throwing is expected.
|
|
653
666
|
*
|
|
654
667
|
* **Example** (Capturing synchronous logging in an Effect)
|
|
655
668
|
*
|
|
@@ -667,7 +680,7 @@ export const suspend = internal.suspend;
|
|
|
667
680
|
* ```
|
|
668
681
|
*
|
|
669
682
|
* @see {@link try_ | try} for a version that can handle failures.
|
|
670
|
-
* @category
|
|
683
|
+
* @category creating effects
|
|
671
684
|
* @since 2.0.0
|
|
672
685
|
*/
|
|
673
686
|
export const sync = internal.sync;
|
|
@@ -676,7 +689,7 @@ export {
|
|
|
676
689
|
/**
|
|
677
690
|
* Returns an effect that succeeds with `void`.
|
|
678
691
|
*
|
|
679
|
-
* @category
|
|
692
|
+
* @category creating effects
|
|
680
693
|
* @since 2.0.0
|
|
681
694
|
*/
|
|
682
695
|
void_ as void };
|
|
@@ -685,7 +698,7 @@ export {
|
|
|
685
698
|
/**
|
|
686
699
|
* Returns an effect that succeeds with `undefined`.
|
|
687
700
|
*
|
|
688
|
-
* @category
|
|
701
|
+
* @category creating effects
|
|
689
702
|
* @since 4.0.0
|
|
690
703
|
*/
|
|
691
704
|
undefined_ as undefined };
|
|
@@ -694,7 +707,7 @@ undefined_ as undefined };
|
|
|
694
707
|
*
|
|
695
708
|
* **When to use**
|
|
696
709
|
*
|
|
697
|
-
* Use
|
|
710
|
+
* Use when integrating APIs that complete through callbacks
|
|
698
711
|
* instead of returning a `Promise`.
|
|
699
712
|
*
|
|
700
713
|
* **Details**
|
|
@@ -721,7 +734,7 @@ undefined_ as undefined };
|
|
|
721
734
|
* const program = delay(1000)
|
|
722
735
|
* ```
|
|
723
736
|
*
|
|
724
|
-
* @category
|
|
737
|
+
* @category creating effects
|
|
725
738
|
* @since 4.0.0
|
|
726
739
|
*/
|
|
727
740
|
export const callback = internal.callback;
|
|
@@ -744,13 +757,13 @@ export const callback = internal.callback;
|
|
|
744
757
|
* const timedProgram = Effect.timeout(program, "1 second")
|
|
745
758
|
* ```
|
|
746
759
|
*
|
|
747
|
-
* @category
|
|
760
|
+
* @category creating effects
|
|
748
761
|
* @since 2.0.0
|
|
749
762
|
*/
|
|
750
763
|
export const never = internal.never;
|
|
751
764
|
/**
|
|
752
|
-
*
|
|
753
|
-
* do notation chains.
|
|
765
|
+
* Effect that succeeds with an empty record `{}`, used as the starting point
|
|
766
|
+
* for do notation chains.
|
|
754
767
|
*
|
|
755
768
|
* **Example** (Starting do notation)
|
|
756
769
|
*
|
|
@@ -765,7 +778,7 @@ export const never = internal.never;
|
|
|
765
778
|
* )
|
|
766
779
|
* ```
|
|
767
780
|
*
|
|
768
|
-
* @category
|
|
781
|
+
* @category do notation
|
|
769
782
|
* @since 2.0.0
|
|
770
783
|
*/
|
|
771
784
|
export const Do = internal.Do;
|
|
@@ -773,7 +786,15 @@ export const Do = internal.Do;
|
|
|
773
786
|
* Gives a name to the success value of an `Effect`, creating a single-key
|
|
774
787
|
* record used in do notation pipelines.
|
|
775
788
|
*
|
|
776
|
-
*
|
|
789
|
+
* **When to use**
|
|
790
|
+
*
|
|
791
|
+
* Use to start a do-notation pipeline from an existing `Effect` when its
|
|
792
|
+
* success value should become the first named field in the accumulated record.
|
|
793
|
+
*
|
|
794
|
+
* @see {@link Do} for starting from an empty accumulated record
|
|
795
|
+
* @see {@link bind} for adding fields produced by effects
|
|
796
|
+
*
|
|
797
|
+
* @category do notation
|
|
777
798
|
* @since 2.0.0
|
|
778
799
|
*/
|
|
779
800
|
export const bindTo = internal.bindTo;
|
|
@@ -782,14 +803,51 @@ export {
|
|
|
782
803
|
/**
|
|
783
804
|
* Adds a computed plain value to the do notation record.
|
|
784
805
|
*
|
|
785
|
-
*
|
|
806
|
+
* **When to use**
|
|
807
|
+
*
|
|
808
|
+
* Use to add a derived, synchronous value to a do-notation pipeline when it
|
|
809
|
+
* depends on fields already accumulated in the record and does not need to run
|
|
810
|
+
* another `Effect`.
|
|
811
|
+
*
|
|
812
|
+
* **Details**
|
|
813
|
+
*
|
|
814
|
+
* The new field is added with object spreading. If the name already exists in
|
|
815
|
+
* the record, the computed value replaces it in the returned type.
|
|
816
|
+
*
|
|
817
|
+
* @see {@link bind} for adding fields produced by effects
|
|
818
|
+
* @see {@link bindTo} for naming an existing success value
|
|
819
|
+
* @see {@link Do} for starting from an empty accumulated record
|
|
820
|
+
* @see {@link gen} for sequencing without accumulating a record
|
|
821
|
+
*
|
|
822
|
+
* @category do notation
|
|
786
823
|
* @since 2.0.0
|
|
787
824
|
*/
|
|
788
825
|
let_ as let };
|
|
789
826
|
/**
|
|
790
827
|
* Adds an `Effect` value to the do notation record under a given name.
|
|
791
828
|
*
|
|
792
|
-
*
|
|
829
|
+
* **When to use**
|
|
830
|
+
*
|
|
831
|
+
* Use to sequence an effectful step in a do-notation pipeline when that step
|
|
832
|
+
* depends on fields already accumulated in the record and its success value
|
|
833
|
+
* should be stored under a name.
|
|
834
|
+
*
|
|
835
|
+
* **Details**
|
|
836
|
+
*
|
|
837
|
+
* The function receives the current record, runs the returned effect after the
|
|
838
|
+
* input effect succeeds, and inserts its success value under `name`. The
|
|
839
|
+
* resulting effect combines the error and service requirements of both steps.
|
|
840
|
+
*
|
|
841
|
+
* **Gotchas**
|
|
842
|
+
*
|
|
843
|
+
* Binding a name that already exists replaces that field in the resulting
|
|
844
|
+
* record.
|
|
845
|
+
*
|
|
846
|
+
* @see {@link Do} for starting from an empty do-notation record
|
|
847
|
+
* @see {@link bindTo} for naming the success value of an existing effect
|
|
848
|
+
* @see {@link gen} for generator-based sequencing without accumulating a record
|
|
849
|
+
*
|
|
850
|
+
* @category do notation
|
|
793
851
|
* @since 2.0.0
|
|
794
852
|
*/
|
|
795
853
|
export const bind = internal.bind;
|
|
@@ -799,7 +857,7 @@ export const bind = internal.bind;
|
|
|
799
857
|
*
|
|
800
858
|
* **When to use**
|
|
801
859
|
*
|
|
802
|
-
* `gen` allows you to write code that looks and behaves like synchronous
|
|
860
|
+
* Use when `gen` allows you to write code that looks and behaves like synchronous
|
|
803
861
|
* code, but it can handle asynchronous tasks, errors, and complex control flow
|
|
804
862
|
* (like loops and conditions). It helps make asynchronous code more readable
|
|
805
863
|
* and easier to manage.
|
|
@@ -841,7 +899,7 @@ export const bind = internal.bind;
|
|
|
841
899
|
* })
|
|
842
900
|
* ```
|
|
843
901
|
*
|
|
844
|
-
* @category
|
|
902
|
+
* @category creating effects
|
|
845
903
|
* @since 2.0.0
|
|
846
904
|
*/
|
|
847
905
|
export const gen = internal.gen;
|
|
@@ -850,7 +908,7 @@ export const gen = internal.gen;
|
|
|
850
908
|
*
|
|
851
909
|
* **When to use**
|
|
852
910
|
*
|
|
853
|
-
* Use
|
|
911
|
+
* Use to explicitly signal an error in an `Effect`. The error
|
|
854
912
|
* will keep propagating unless it is handled. You can handle the error with
|
|
855
913
|
* functions like {@link catchTag} or {@link catchTags}.
|
|
856
914
|
*
|
|
@@ -869,17 +927,20 @@ export const gen = internal.gen;
|
|
|
869
927
|
* ```
|
|
870
928
|
*
|
|
871
929
|
* @see {@link succeed} to create an effect that represents a successful value.
|
|
872
|
-
* @category
|
|
930
|
+
* @category creating effects
|
|
873
931
|
* @since 2.0.0
|
|
874
932
|
*/
|
|
875
933
|
export const fail = internal.fail;
|
|
876
934
|
/**
|
|
877
935
|
* Creates an `Effect` that represents a recoverable error using a lazy evaluation.
|
|
878
936
|
*
|
|
937
|
+
* **When to use**
|
|
938
|
+
*
|
|
939
|
+
* Use to defer computing a recoverable error value until the effect is run.
|
|
940
|
+
*
|
|
879
941
|
* **Details**
|
|
880
942
|
*
|
|
881
|
-
*
|
|
882
|
-
* defer the computation of the error value until the effect is actually run.
|
|
943
|
+
* The error-producing function is evaluated each time the effect is executed.
|
|
883
944
|
*
|
|
884
945
|
* **Example** (Lazily creating failures)
|
|
885
946
|
*
|
|
@@ -894,7 +955,7 @@ export const fail = internal.fail;
|
|
|
894
955
|
* // Output: { _id: 'Exit', _tag: 'Failure', cause: ... }
|
|
895
956
|
* ```
|
|
896
957
|
*
|
|
897
|
-
* @category
|
|
958
|
+
* @category creating effects
|
|
898
959
|
* @since 2.0.0
|
|
899
960
|
*/
|
|
900
961
|
export const failSync = internal.failSync;
|
|
@@ -919,17 +980,20 @@ export const failSync = internal.failSync;
|
|
|
919
980
|
* // Output: { _id: 'Exit', _tag: 'Failure', cause: ... }
|
|
920
981
|
* ```
|
|
921
982
|
*
|
|
922
|
-
* @category
|
|
983
|
+
* @category creating effects
|
|
923
984
|
* @since 2.0.0
|
|
924
985
|
*/
|
|
925
986
|
export const failCause = internal.failCause;
|
|
926
987
|
/**
|
|
927
988
|
* Creates an `Effect` that represents a failure with a `Cause` computed lazily.
|
|
928
989
|
*
|
|
990
|
+
* **When to use**
|
|
991
|
+
*
|
|
992
|
+
* Use to defer computing a full `Cause` until the effect is run.
|
|
993
|
+
*
|
|
929
994
|
* **Details**
|
|
930
995
|
*
|
|
931
|
-
*
|
|
932
|
-
* complex cause but want to defer the computation until the effect is run.
|
|
996
|
+
* The cause-producing function is evaluated each time the effect is executed.
|
|
933
997
|
*
|
|
934
998
|
* **Example** (Lazily creating a Cause)
|
|
935
999
|
*
|
|
@@ -944,7 +1008,7 @@ export const failCause = internal.failCause;
|
|
|
944
1008
|
* // Output: { _id: 'Exit', _tag: 'Failure', cause: ... }
|
|
945
1009
|
* ```
|
|
946
1010
|
*
|
|
947
|
-
* @category
|
|
1011
|
+
* @category creating effects
|
|
948
1012
|
* @since 2.0.0
|
|
949
1013
|
*/
|
|
950
1014
|
export const failCauseSync = internal.failCauseSync;
|
|
@@ -953,7 +1017,7 @@ export const failCauseSync = internal.failCauseSync;
|
|
|
953
1017
|
*
|
|
954
1018
|
* **When to use**
|
|
955
1019
|
*
|
|
956
|
-
* Use
|
|
1020
|
+
* Use when encountering unexpected conditions in your code that should
|
|
957
1021
|
* not be handled as regular errors but instead represent unrecoverable defects.
|
|
958
1022
|
*
|
|
959
1023
|
* **Details**
|
|
@@ -985,8 +1049,7 @@ export const failCauseSync = internal.failCauseSync;
|
|
|
985
1049
|
* // ...stack trace...
|
|
986
1050
|
* ```
|
|
987
1051
|
*
|
|
988
|
-
* @
|
|
989
|
-
* @category Creating Effects
|
|
1052
|
+
* @category creating effects
|
|
990
1053
|
* @since 2.0.0
|
|
991
1054
|
*/
|
|
992
1055
|
export const die = internal.die;
|
|
@@ -998,7 +1061,7 @@ export {
|
|
|
998
1061
|
*
|
|
999
1062
|
* **When to use**
|
|
1000
1063
|
*
|
|
1001
|
-
*
|
|
1064
|
+
* Use when in situations where you need to perform synchronous operations that might
|
|
1002
1065
|
* fail, such as parsing JSON, you can use the `try` constructor. This
|
|
1003
1066
|
* constructor is designed to handle operations that could throw exceptions by
|
|
1004
1067
|
* capturing those exceptions and transforming them into manageable errors.
|
|
@@ -1053,7 +1116,7 @@ export {
|
|
|
1053
1116
|
*
|
|
1054
1117
|
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
1055
1118
|
* throw errors.
|
|
1056
|
-
* @category
|
|
1119
|
+
* @category creating effects
|
|
1057
1120
|
* @since 2.0.0
|
|
1058
1121
|
*/
|
|
1059
1122
|
try_ as try };
|
|
@@ -1074,7 +1137,7 @@ try_ as try };
|
|
|
1074
1137
|
* Effect.runPromise(program)
|
|
1075
1138
|
* ```
|
|
1076
1139
|
*
|
|
1077
|
-
* @category
|
|
1140
|
+
* @category creating effects
|
|
1078
1141
|
* @since 2.0.0
|
|
1079
1142
|
*/
|
|
1080
1143
|
export const yieldNow = internal.yieldNow;
|
|
@@ -1095,7 +1158,7 @@ export const yieldNow = internal.yieldNow;
|
|
|
1095
1158
|
* Effect.runPromise(program)
|
|
1096
1159
|
* ```
|
|
1097
1160
|
*
|
|
1098
|
-
* @category
|
|
1161
|
+
* @category creating effects
|
|
1099
1162
|
* @since 4.0.0
|
|
1100
1163
|
*/
|
|
1101
1164
|
export const yieldNowWith = internal.yieldNowWith;
|
|
@@ -1115,7 +1178,7 @@ export const yieldNowWith = internal.yieldNowWith;
|
|
|
1115
1178
|
* // Output: Fiber ID: 1
|
|
1116
1179
|
* ```
|
|
1117
1180
|
*
|
|
1118
|
-
* @category
|
|
1181
|
+
* @category creating effects
|
|
1119
1182
|
* @since 4.0.0
|
|
1120
1183
|
*/
|
|
1121
1184
|
export const withFiber = core.withFiber;
|
|
@@ -1208,7 +1271,7 @@ export const fromNullishOr = internal.fromNullishOr;
|
|
|
1208
1271
|
*
|
|
1209
1272
|
* **When to use**
|
|
1210
1273
|
*
|
|
1211
|
-
* Use
|
|
1274
|
+
* Use when you need to chain multiple effects, ensuring that each
|
|
1212
1275
|
* step produces a new `Effect` while flattening any nested effects that may
|
|
1213
1276
|
* occur.
|
|
1214
1277
|
*
|
|
@@ -1296,7 +1359,7 @@ export const flatten = internal.flatten;
|
|
|
1296
1359
|
*
|
|
1297
1360
|
* **When to use**
|
|
1298
1361
|
*
|
|
1299
|
-
* Use
|
|
1362
|
+
* Use when one effect must run after another and the second effect
|
|
1300
1363
|
* may depend on the first effect's success value.
|
|
1301
1364
|
*
|
|
1302
1365
|
* **Details**
|
|
@@ -1372,7 +1435,7 @@ export const andThen = internal.andThen;
|
|
|
1372
1435
|
*
|
|
1373
1436
|
* **When to use**
|
|
1374
1437
|
*
|
|
1375
|
-
* Use
|
|
1438
|
+
* Use when you want to perform a side effect, like logging or tracking,
|
|
1376
1439
|
* without modifying the main value. This is useful when you need to observe or
|
|
1377
1440
|
* record an action but want the original value to be passed to the next step.
|
|
1378
1441
|
*
|
|
@@ -1421,7 +1484,13 @@ export const andThen = internal.andThen;
|
|
|
1421
1484
|
*/
|
|
1422
1485
|
export const tap = internal.tap;
|
|
1423
1486
|
/**
|
|
1424
|
-
*
|
|
1487
|
+
* Converts both success and failure of an `Effect` into a `Result` type.
|
|
1488
|
+
*
|
|
1489
|
+
* **When to use**
|
|
1490
|
+
*
|
|
1491
|
+
* Use when you want to handle typed failures as data while preserving
|
|
1492
|
+
* the original error value. Use `option` when you only care whether the effect
|
|
1493
|
+
* succeeded, and `exit` when you need the full failure cause.
|
|
1425
1494
|
*
|
|
1426
1495
|
* **Details**
|
|
1427
1496
|
*
|
|
@@ -1435,14 +1504,15 @@ export const tap = internal.tap;
|
|
|
1435
1504
|
* you want to chain effects and manage both success and failure in the same
|
|
1436
1505
|
* logical flow.
|
|
1437
1506
|
*
|
|
1438
|
-
* It's important to note that unrecoverable errors, often referred to as
|
|
1439
|
-
* "defects," are still thrown and not captured within the `Result` type. Only
|
|
1440
|
-
* failures that are explicitly represented as recoverable errors in the effect
|
|
1441
|
-
* are encapsulated.
|
|
1442
|
-
*
|
|
1443
1507
|
* The resulting effect cannot fail directly because all recoverable failures
|
|
1444
1508
|
* are represented inside the `Result` type.
|
|
1445
1509
|
*
|
|
1510
|
+
* **Gotchas**
|
|
1511
|
+
*
|
|
1512
|
+
* `result` only captures typed, recoverable failures. Defects and
|
|
1513
|
+
* interruptions are not captured inside the `Result` and still fail the
|
|
1514
|
+
* effect.
|
|
1515
|
+
*
|
|
1446
1516
|
* **Example** (Capturing success or failure as Result)
|
|
1447
1517
|
*
|
|
1448
1518
|
* ```ts
|
|
@@ -1464,18 +1534,33 @@ export const tap = internal.tap;
|
|
|
1464
1534
|
* @see {@link option} for a version that uses `Option` instead.
|
|
1465
1535
|
* @see {@link exit} for a version that encapsulates both recoverable errors and defects in an `Exit`.
|
|
1466
1536
|
*
|
|
1467
|
-
* @category
|
|
1537
|
+
* @category outcome encapsulation
|
|
1468
1538
|
* @since 4.0.0
|
|
1469
1539
|
*/
|
|
1470
1540
|
export const result = internal.result;
|
|
1471
1541
|
/**
|
|
1472
|
-
*
|
|
1542
|
+
* Converts success to `Option.some` and failure to `Option.none`.
|
|
1543
|
+
*
|
|
1544
|
+
* **When to use**
|
|
1545
|
+
*
|
|
1546
|
+
* Use when the failure value is not important and absence is enough.
|
|
1547
|
+
* Use `result` when you need the original typed failure, and `exit` when you
|
|
1548
|
+
* need the full failure cause.
|
|
1473
1549
|
*
|
|
1474
1550
|
* **Details**
|
|
1475
1551
|
*
|
|
1476
1552
|
* Success values become `Option.some`, recoverable failures become
|
|
1477
1553
|
* `Option.none`, and defects still fail the effect.
|
|
1478
1554
|
*
|
|
1555
|
+
* **Gotchas**
|
|
1556
|
+
*
|
|
1557
|
+
* `option` only captures typed, recoverable failures as `Option.none`.
|
|
1558
|
+
* Defects and interruptions are not captured inside the `Option` and still
|
|
1559
|
+
* fail the effect.
|
|
1560
|
+
*
|
|
1561
|
+
* `option` also discards typed failure values. Use `result` if the failure
|
|
1562
|
+
* value matters.
|
|
1563
|
+
*
|
|
1479
1564
|
* **Example** (Capturing success or failure as Option)
|
|
1480
1565
|
*
|
|
1481
1566
|
* ```ts
|
|
@@ -1497,7 +1582,7 @@ export const result = internal.result;
|
|
|
1497
1582
|
* @see {@link result} for a version that uses `Result` instead.
|
|
1498
1583
|
* @see {@link exit} for a version that encapsulates both recoverable errors and defects in an `Exit`.
|
|
1499
1584
|
*
|
|
1500
|
-
* @category
|
|
1585
|
+
* @category outcome encapsulation
|
|
1501
1586
|
* @since 2.0.0
|
|
1502
1587
|
*/
|
|
1503
1588
|
export const option = internal.option;
|
|
@@ -1505,6 +1590,12 @@ export const option = internal.option;
|
|
|
1505
1590
|
* Transforms an effect to encapsulate both failure and success using the `Exit`
|
|
1506
1591
|
* data type.
|
|
1507
1592
|
*
|
|
1593
|
+
* **When to use**
|
|
1594
|
+
*
|
|
1595
|
+
* Use when you need to inspect the full outcome, including typed
|
|
1596
|
+
* failures, defects, and interruptions. Use `result` or `option` when you only
|
|
1597
|
+
* need to handle typed failures.
|
|
1598
|
+
*
|
|
1508
1599
|
* **Details**
|
|
1509
1600
|
*
|
|
1510
1601
|
* `exit` wraps an effect's success or failure inside an `Exit` type, allowing
|
|
@@ -1535,13 +1626,19 @@ export const option = internal.option;
|
|
|
1535
1626
|
* @see {@link option} for a version that uses `Option` instead.
|
|
1536
1627
|
* @see {@link result} for a version that uses `Result` instead.
|
|
1537
1628
|
*
|
|
1538
|
-
* @category
|
|
1629
|
+
* @category outcome encapsulation
|
|
1539
1630
|
* @since 2.0.0
|
|
1540
1631
|
*/
|
|
1541
1632
|
export const exit = internal.exit;
|
|
1542
1633
|
/**
|
|
1543
1634
|
* Transforms the value inside an effect by applying a function to it.
|
|
1544
1635
|
*
|
|
1636
|
+
* **When to use**
|
|
1637
|
+
*
|
|
1638
|
+
* Use to transform an effect's success value with a function that returns a
|
|
1639
|
+
* plain value, producing a new effect without changing the original effect's
|
|
1640
|
+
* typed error or context requirements.
|
|
1641
|
+
*
|
|
1545
1642
|
* **Details**
|
|
1546
1643
|
*
|
|
1547
1644
|
* `map` takes a function and applies it to the value contained within an
|
|
@@ -1592,6 +1689,11 @@ export const map = internal.map;
|
|
|
1592
1689
|
/**
|
|
1593
1690
|
* Replaces the value inside an effect with a constant value.
|
|
1594
1691
|
*
|
|
1692
|
+
* **When to use**
|
|
1693
|
+
*
|
|
1694
|
+
* Use to replace a successful value with a constant while preserving failures
|
|
1695
|
+
* and requirements.
|
|
1696
|
+
*
|
|
1595
1697
|
* **Details**
|
|
1596
1698
|
*
|
|
1597
1699
|
* `as` allows you to ignore the original value inside an effect and
|
|
@@ -1609,14 +1711,15 @@ export const map = internal.map;
|
|
|
1609
1711
|
* // Output: "new value"
|
|
1610
1712
|
* ```
|
|
1611
1713
|
*
|
|
1714
|
+
* @see {@link map} for deriving the replacement value from the success value
|
|
1715
|
+
* @see {@link asVoid} for replacing the success value with `void`
|
|
1716
|
+
*
|
|
1612
1717
|
* @category mapping
|
|
1613
1718
|
* @since 2.0.0
|
|
1614
1719
|
*/
|
|
1615
1720
|
export const as = internal.as;
|
|
1616
1721
|
/**
|
|
1617
|
-
*
|
|
1618
|
-
* in an `Option` value. If the original `Effect` value fails, the returned
|
|
1619
|
-
* `Effect` value will also fail.
|
|
1722
|
+
* Maps the success value of an `Effect` to `Some`, preserving failures.
|
|
1620
1723
|
*
|
|
1621
1724
|
* **Example** (Wrapping success in Option.some)
|
|
1622
1725
|
*
|
|
@@ -1634,10 +1737,7 @@ export const as = internal.as;
|
|
|
1634
1737
|
*/
|
|
1635
1738
|
export const asSome = internal.asSome;
|
|
1636
1739
|
/**
|
|
1637
|
-
*
|
|
1638
|
-
* original `Effect` value succeeds, the returned `Effect` value will also
|
|
1639
|
-
* succeed. If the original `Effect` value fails, the returned `Effect` value
|
|
1640
|
-
* will fail with the same error.
|
|
1740
|
+
* Maps the success value of an `Effect` to `void`, preserving failures.
|
|
1641
1741
|
*
|
|
1642
1742
|
* **Example** (Discarding success values)
|
|
1643
1743
|
*
|
|
@@ -1655,15 +1755,16 @@ export const asSome = internal.asSome;
|
|
|
1655
1755
|
*/
|
|
1656
1756
|
export const asVoid = internal.asVoid;
|
|
1657
1757
|
/**
|
|
1658
|
-
*
|
|
1659
|
-
*
|
|
1758
|
+
* Swaps an effect's success and failure channels.
|
|
1759
|
+
*
|
|
1760
|
+
* **When to use**
|
|
1761
|
+
*
|
|
1762
|
+
* Use to handle the failure value as a success, or to move the success value
|
|
1763
|
+
* into the failure channel.
|
|
1660
1764
|
*
|
|
1661
1765
|
* **Details**
|
|
1662
1766
|
*
|
|
1663
|
-
*
|
|
1664
|
-
* treating the previously successful values as errors and vice versa. This can
|
|
1665
|
-
* be helpful in scenarios where you want to handle a success as a failure or
|
|
1666
|
-
* treat an error as a valid result.
|
|
1767
|
+
* For an `Effect<A, E, R>`, the returned effect has type `Effect<E, A, R>`.
|
|
1667
1768
|
*
|
|
1668
1769
|
* **Example** (Swapping success and failure channels)
|
|
1669
1770
|
*
|
|
@@ -1689,6 +1790,10 @@ export const flip = internal.flip;
|
|
|
1689
1790
|
/**
|
|
1690
1791
|
* Combines two effects into a single effect, producing a tuple with the results of both effects.
|
|
1691
1792
|
*
|
|
1793
|
+
* **When to use**
|
|
1794
|
+
*
|
|
1795
|
+
* Use to combine exactly two effects into a tuple.
|
|
1796
|
+
*
|
|
1692
1797
|
* **Details**
|
|
1693
1798
|
*
|
|
1694
1799
|
* The `zip` function executes the first effect (left) and then the second effect (right).
|
|
@@ -1751,7 +1856,8 @@ export const flip = internal.flip;
|
|
|
1751
1856
|
* ```
|
|
1752
1857
|
*
|
|
1753
1858
|
* @see {@link zipWith} for a version that combines the results with a custom function.
|
|
1754
|
-
* @see {@link
|
|
1859
|
+
* @see {@link all} for collecting a larger structure of effects.
|
|
1860
|
+
*
|
|
1755
1861
|
* @category zipping
|
|
1756
1862
|
* @since 2.0.0
|
|
1757
1863
|
*/
|
|
@@ -1762,9 +1868,8 @@ export const zip = internal.zip;
|
|
|
1762
1868
|
*
|
|
1763
1869
|
* **When to use**
|
|
1764
1870
|
*
|
|
1765
|
-
*
|
|
1766
|
-
*
|
|
1767
|
-
* effects, combining them into a single value.
|
|
1871
|
+
* Use when you need to run two effects sequentially and combine their results
|
|
1872
|
+
* with a function instead of keeping the results as a tuple.
|
|
1768
1873
|
*
|
|
1769
1874
|
* **Details**
|
|
1770
1875
|
*
|
|
@@ -1835,13 +1940,13 @@ catch_ as catch };
|
|
|
1835
1940
|
*
|
|
1836
1941
|
* **When to use**
|
|
1837
1942
|
*
|
|
1838
|
-
*
|
|
1839
|
-
*
|
|
1840
|
-
* error types by matching the `_tag` value. This allows for precise error
|
|
1841
|
-
* handling, ensuring that only specific errors are caught and handled.
|
|
1943
|
+
* Use when recovering from one specific tagged error in an effect error
|
|
1944
|
+
* channel.
|
|
1842
1945
|
*
|
|
1843
|
-
*
|
|
1844
|
-
*
|
|
1946
|
+
* **Details**
|
|
1947
|
+
*
|
|
1948
|
+
* The error type must have a readonly `_tag` field. `catchTag` matches that
|
|
1949
|
+
* field and only handles errors with the requested tag.
|
|
1845
1950
|
*
|
|
1846
1951
|
* **Example** (Handling a tagged error)
|
|
1847
1952
|
*
|
|
@@ -1867,6 +1972,9 @@ catch_ as catch };
|
|
|
1867
1972
|
* )
|
|
1868
1973
|
* ```
|
|
1869
1974
|
*
|
|
1975
|
+
* @see {@link catchTags} for handling multiple tagged errors in one call
|
|
1976
|
+
* @see {@link catchIf} for recovering from errors that match a predicate
|
|
1977
|
+
*
|
|
1870
1978
|
* @category error handling
|
|
1871
1979
|
* @since 2.0.0
|
|
1872
1980
|
*/
|
|
@@ -1876,12 +1984,9 @@ export const catchTag = internal.catchTag;
|
|
|
1876
1984
|
*
|
|
1877
1985
|
* **When to use**
|
|
1878
1986
|
*
|
|
1879
|
-
*
|
|
1880
|
-
*
|
|
1881
|
-
*
|
|
1882
|
-
* for that specific error. This allows you to catch and recover from multiple
|
|
1883
|
-
* error types in a single call. You can also provide a fallback handler for
|
|
1884
|
-
* unhandled errors.
|
|
1987
|
+
* Use when one recovery step should handle several tagged error types by
|
|
1988
|
+
* matching their readonly `_tag` fields. Pass a handler table whose keys are
|
|
1989
|
+
* tags, plus an optional fallback for unmatched errors.
|
|
1885
1990
|
*
|
|
1886
1991
|
* The error type must have a readonly `_tag` field to use `catchTag`. This
|
|
1887
1992
|
* field is used to identify and match errors.
|
|
@@ -1918,6 +2023,11 @@ export const catchTags = internal.catchTags;
|
|
|
1918
2023
|
/**
|
|
1919
2024
|
* Catches a specific reason within a tagged error.
|
|
1920
2025
|
*
|
|
2026
|
+
* **When to use**
|
|
2027
|
+
*
|
|
2028
|
+
* Use to handle one nested reason inside a tagged error while preserving the
|
|
2029
|
+
* parent error shape for unmatched reasons.
|
|
2030
|
+
*
|
|
1921
2031
|
* **Details**
|
|
1922
2032
|
*
|
|
1923
2033
|
* Use this to handle nested error causes without removing the parent error
|
|
@@ -1950,6 +2060,8 @@ export const catchTags = internal.catchTags;
|
|
|
1950
2060
|
* )
|
|
1951
2061
|
* ```
|
|
1952
2062
|
*
|
|
2063
|
+
* @see {@link catchReasons} for handling several nested reason tags
|
|
2064
|
+
*
|
|
1953
2065
|
* @category error handling
|
|
1954
2066
|
* @since 4.0.0
|
|
1955
2067
|
*/
|
|
@@ -2028,10 +2140,8 @@ export const unwrapReason = internal.unwrapReason;
|
|
|
2028
2140
|
*
|
|
2029
2141
|
* **When to use**
|
|
2030
2142
|
*
|
|
2031
|
-
*
|
|
2032
|
-
*
|
|
2033
|
-
* based on the `Cause` of the error, which provides detailed information about
|
|
2034
|
-
* the failure.
|
|
2143
|
+
* Use when recovery needs the full `Cause`, including recoverable failures,
|
|
2144
|
+
* defects, and interruptions, instead of only the typed error value.
|
|
2035
2145
|
*
|
|
2036
2146
|
* **Details**
|
|
2037
2147
|
*
|
|
@@ -2069,7 +2179,7 @@ export const catchCause = internal.catchCause;
|
|
|
2069
2179
|
*
|
|
2070
2180
|
* **When to use**
|
|
2071
2181
|
*
|
|
2072
|
-
* Use this sparingly, usually at integration boundaries where defects must be
|
|
2182
|
+
* Use when you use this sparingly, usually at integration boundaries where defects must be
|
|
2073
2183
|
* reported or translated for an external system.
|
|
2074
2184
|
*
|
|
2075
2185
|
* **Details**
|
|
@@ -2110,7 +2220,7 @@ export const catchDefect = internal.catchDefect;
|
|
|
2110
2220
|
*
|
|
2111
2221
|
* **When to use**
|
|
2112
2222
|
*
|
|
2113
|
-
*
|
|
2223
|
+
* Use when you need to recover from errors that match a condition. Use a
|
|
2114
2224
|
* `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
2115
2225
|
* matching. Non-matching errors re-fail with the original cause. Defects and
|
|
2116
2226
|
* interrupts are not caught.
|
|
@@ -2148,6 +2258,24 @@ export const catchIf = internal.catchIf;
|
|
|
2148
2258
|
/**
|
|
2149
2259
|
* Recovers from specific errors using a `Filter`.
|
|
2150
2260
|
*
|
|
2261
|
+
* **When to use**
|
|
2262
|
+
*
|
|
2263
|
+
* Use to recover from typed `Effect` errors with a reusable `Filter` when
|
|
2264
|
+
* matching can also narrow or transform the error before choosing the recovery
|
|
2265
|
+
* effect.
|
|
2266
|
+
*
|
|
2267
|
+
* **Details**
|
|
2268
|
+
*
|
|
2269
|
+
* The filter runs on typed failures extracted from the `Cause`. Successful
|
|
2270
|
+
* filter results are passed to `f`; failed filter results are passed to
|
|
2271
|
+
* `orElse` when provided. Without `orElse`, the original failure cause is
|
|
2272
|
+
* preserved.
|
|
2273
|
+
*
|
|
2274
|
+
* @see {@link catchIf} for predicate-based recovery from typed errors
|
|
2275
|
+
* @see {@link catchTag} for recovering from a single tagged error
|
|
2276
|
+
* @see {@link catchTags} for recovering from several tagged errors
|
|
2277
|
+
* @see {@link catchCauseFilter} for filtering full causes instead of typed errors
|
|
2278
|
+
*
|
|
2151
2279
|
* @category error handling
|
|
2152
2280
|
* @since 4.0.0
|
|
2153
2281
|
*/
|
|
@@ -2155,6 +2283,10 @@ export const catchFilter = internal.catchFilter;
|
|
|
2155
2283
|
/**
|
|
2156
2284
|
* Catches `NoSuchElementError` failures and converts them to `Option.none`.
|
|
2157
2285
|
*
|
|
2286
|
+
* **When to use**
|
|
2287
|
+
*
|
|
2288
|
+
* Use to convert `NoSuchElementError` failures into `Option.none`.
|
|
2289
|
+
*
|
|
2158
2290
|
* **Details**
|
|
2159
2291
|
*
|
|
2160
2292
|
* Success values become `Option.some`, `NoSuchElementError` becomes
|
|
@@ -2172,6 +2304,10 @@ export const catchFilter = internal.catchFilter;
|
|
|
2172
2304
|
* Effect.runPromise(none).then(console.log) // { _id: 'Option', _tag: 'None' }
|
|
2173
2305
|
* ```
|
|
2174
2306
|
*
|
|
2307
|
+
* @see {@link fromOption} for converting `Option.none` into `NoSuchElementError`
|
|
2308
|
+
* @see {@link fromNullishOr} for converting nullish values into `NoSuchElementError`
|
|
2309
|
+
* @see {@link option} for converting any failure into `Option.none`
|
|
2310
|
+
*
|
|
2175
2311
|
* @category error handling
|
|
2176
2312
|
* @since 4.0.0
|
|
2177
2313
|
*/
|
|
@@ -2179,6 +2315,10 @@ export const catchNoSuchElement = internal.catchNoSuchElement;
|
|
|
2179
2315
|
/**
|
|
2180
2316
|
* Recovers from specific failures based on a predicate.
|
|
2181
2317
|
*
|
|
2318
|
+
* **When to use**
|
|
2319
|
+
*
|
|
2320
|
+
* Use to recover from full causes selected by a predicate.
|
|
2321
|
+
*
|
|
2182
2322
|
* **Details**
|
|
2183
2323
|
*
|
|
2184
2324
|
* This function allows you to conditionally catch and recover from failures
|
|
@@ -2208,6 +2348,10 @@ export const catchNoSuchElement = internal.catchNoSuchElement;
|
|
|
2208
2348
|
* // Then: "Fallback response"
|
|
2209
2349
|
* ```
|
|
2210
2350
|
*
|
|
2351
|
+
* @see {@link catchCause} for recovering from every cause
|
|
2352
|
+
* @see {@link catchCauseFilter} for selecting full causes with a `Filter`
|
|
2353
|
+
* @see {@link catchIf} for predicate-based recovery from typed errors
|
|
2354
|
+
*
|
|
2211
2355
|
* @category error handling
|
|
2212
2356
|
* @since 4.0.0
|
|
2213
2357
|
*/
|
|
@@ -2215,20 +2359,36 @@ export const catchCauseIf = internal.catchCauseIf;
|
|
|
2215
2359
|
/**
|
|
2216
2360
|
* Recovers from specific failures based on a `Filter`.
|
|
2217
2361
|
*
|
|
2362
|
+
* **When to use**
|
|
2363
|
+
*
|
|
2364
|
+
* Use when you need to recover only from causes selected by a `Filter`, and the
|
|
2365
|
+
* recovery needs both the selected value and the original `Cause`.
|
|
2366
|
+
*
|
|
2367
|
+
* **Details**
|
|
2368
|
+
*
|
|
2369
|
+
* The filter is applied to the full `Cause`. When it succeeds, the handler
|
|
2370
|
+
* receives the selected value and the original cause. When it fails, the effect
|
|
2371
|
+
* re-fails with the residual cause returned by the filter.
|
|
2372
|
+
*
|
|
2373
|
+
* @see {@link catchCauseIf} for predicate-based cause selection
|
|
2374
|
+
* @see {@link catchFilter} for filtering typed error values instead of full causes
|
|
2375
|
+
* @see {@link catchCause} for recovering from every cause without filtering
|
|
2376
|
+
*
|
|
2218
2377
|
* @category error handling
|
|
2219
2378
|
* @since 4.0.0
|
|
2220
2379
|
*/
|
|
2221
2380
|
export const catchCauseFilter = internal.catchCauseFilter;
|
|
2222
2381
|
/**
|
|
2223
|
-
*
|
|
2224
|
-
*
|
|
2382
|
+
* Transforms the failure value of an effect without changing its success value.
|
|
2383
|
+
*
|
|
2384
|
+
* **When to use**
|
|
2385
|
+
*
|
|
2386
|
+
* Use to translate typed failures while leaving successful values unchanged.
|
|
2225
2387
|
*
|
|
2226
2388
|
* **Details**
|
|
2227
2389
|
*
|
|
2228
|
-
*
|
|
2229
|
-
*
|
|
2230
|
-
* keeping the original behavior of the effect's success values intact. It only
|
|
2231
|
-
* operates on the error channel and leaves the success channel unchanged.
|
|
2390
|
+
* Only the failure channel is transformed. The success channel and requirements
|
|
2391
|
+
* are preserved.
|
|
2232
2392
|
*
|
|
2233
2393
|
* **Example** (Transforming the error channel)
|
|
2234
2394
|
*
|
|
@@ -2251,7 +2411,7 @@ export const catchCauseFilter = internal.catchCauseFilter;
|
|
|
2251
2411
|
*
|
|
2252
2412
|
* @see {@link map} for a version that operates on the success channel.
|
|
2253
2413
|
* @see {@link mapBoth} for a version that operates on both channels.
|
|
2254
|
-
*
|
|
2414
|
+
*
|
|
2255
2415
|
* @category error handling
|
|
2256
2416
|
* @since 2.0.0
|
|
2257
2417
|
*/
|
|
@@ -2259,6 +2419,11 @@ export const mapError = internal.mapError;
|
|
|
2259
2419
|
/**
|
|
2260
2420
|
* Applies transformations to both the success and error channels of an effect.
|
|
2261
2421
|
*
|
|
2422
|
+
* **When to use**
|
|
2423
|
+
*
|
|
2424
|
+
* Use to transform both success and failure values without changing whether the
|
|
2425
|
+
* effect succeeds or fails.
|
|
2426
|
+
*
|
|
2262
2427
|
* **Details**
|
|
2263
2428
|
*
|
|
2264
2429
|
* This function takes two map functions as arguments: one for the error channel
|
|
@@ -2298,7 +2463,7 @@ export const mapBoth = internal.mapBoth;
|
|
|
2298
2463
|
*
|
|
2299
2464
|
* **When to use**
|
|
2300
2465
|
*
|
|
2301
|
-
* Use
|
|
2466
|
+
* Use when a typed failure represents an unrecoverable bug or invalid
|
|
2302
2467
|
* state and should not be handled as a recoverable error.
|
|
2303
2468
|
*
|
|
2304
2469
|
* **Example** (Converting typed failures into defects)
|
|
@@ -2323,8 +2488,7 @@ export const mapBoth = internal.mapBoth;
|
|
|
2323
2488
|
* // ...stack trace...
|
|
2324
2489
|
* ```
|
|
2325
2490
|
*
|
|
2326
|
-
* @
|
|
2327
|
-
* @category Converting Failures to Defects
|
|
2491
|
+
* @category converting failures to defects
|
|
2328
2492
|
* @since 2.0.0
|
|
2329
2493
|
*/
|
|
2330
2494
|
export const orDie = internal.orDie;
|
|
@@ -2431,7 +2595,7 @@ export const tapErrorTag = internal.tapErrorTag;
|
|
|
2431
2595
|
*/
|
|
2432
2596
|
export const tapCause = internal.tapCause;
|
|
2433
2597
|
/**
|
|
2434
|
-
*
|
|
2598
|
+
* Executes a side effect conditionally when a failed effect's cause matches a predicate.
|
|
2435
2599
|
*
|
|
2436
2600
|
* **Details**
|
|
2437
2601
|
*
|
|
@@ -2463,7 +2627,22 @@ export const tapCause = internal.tapCause;
|
|
|
2463
2627
|
*/
|
|
2464
2628
|
export const tapCauseIf = internal.tapCauseIf;
|
|
2465
2629
|
/**
|
|
2466
|
-
*
|
|
2630
|
+
* Executes a side effect conditionally when a failed effect's cause passes a filter.
|
|
2631
|
+
*
|
|
2632
|
+
* **When to use**
|
|
2633
|
+
*
|
|
2634
|
+
* Use when you need to observe only failure causes selected by a `Filter`, and
|
|
2635
|
+
* the side effect needs both the selected value and the original `Cause`.
|
|
2636
|
+
*
|
|
2637
|
+
* **Details**
|
|
2638
|
+
*
|
|
2639
|
+
* A successful filter result runs the side effect with the selected value and
|
|
2640
|
+
* original cause. A failed filter result skips the side effect and preserves the
|
|
2641
|
+
* original cause.
|
|
2642
|
+
*
|
|
2643
|
+
* @see {@link tapCauseIf} for selecting causes with a boolean predicate
|
|
2644
|
+
* @see {@link tapCause} for observing every failure cause
|
|
2645
|
+
* @see {@link catchCauseFilter} for recovering from selected causes instead of only observing them
|
|
2467
2646
|
*
|
|
2468
2647
|
* @category sequencing
|
|
2469
2648
|
* @since 4.0.0
|
|
@@ -2550,7 +2729,7 @@ export const tapDefect = internal.tapDefect;
|
|
|
2550
2729
|
* // Ready
|
|
2551
2730
|
* ```
|
|
2552
2731
|
*
|
|
2553
|
-
* @category
|
|
2732
|
+
* @category repetition / recursion
|
|
2554
2733
|
* @since 2.0.0
|
|
2555
2734
|
*/
|
|
2556
2735
|
export const eventually = internal.eventually;
|
|
@@ -2559,7 +2738,7 @@ export const eventually = internal.eventually;
|
|
|
2559
2738
|
*
|
|
2560
2739
|
* **When to use**
|
|
2561
2740
|
*
|
|
2562
|
-
* Use
|
|
2741
|
+
* Use when typed failures may be transient, such as network issues or
|
|
2563
2742
|
* temporary resource unavailability.
|
|
2564
2743
|
*
|
|
2565
2744
|
* **Details**
|
|
@@ -2569,7 +2748,13 @@ export const eventually = internal.eventually;
|
|
|
2569
2748
|
* succeeds, the returned effect succeeds with that value. If the policy stops
|
|
2570
2749
|
* while the effect is still failing, the last failure is propagated.
|
|
2571
2750
|
*
|
|
2572
|
-
*
|
|
2751
|
+
* **Gotchas**
|
|
2752
|
+
*
|
|
2753
|
+
* The source effect is always evaluated once before any retry policy is
|
|
2754
|
+
* applied. For example, `Schedule.recurs(3)` allows up to three retries after
|
|
2755
|
+
* the initial attempt.
|
|
2756
|
+
*
|
|
2757
|
+
* Defects and interruptions are not retried.
|
|
2573
2758
|
*
|
|
2574
2759
|
* **Example** (Retrying with a schedule)
|
|
2575
2760
|
*
|
|
@@ -2606,8 +2791,8 @@ export const retry = internalSchedule.retry;
|
|
|
2606
2791
|
*
|
|
2607
2792
|
* **When to use**
|
|
2608
2793
|
*
|
|
2609
|
-
*
|
|
2610
|
-
*
|
|
2794
|
+
* Use when you want to handle failures gracefully by specifying an alternative
|
|
2795
|
+
* action after repeated failures.
|
|
2611
2796
|
*
|
|
2612
2797
|
* **Details**
|
|
2613
2798
|
*
|
|
@@ -2684,8 +2869,6 @@ export const retryOrElse = internalSchedule.retryOrElse;
|
|
|
2684
2869
|
* // Output: "Caught cause: Something went wrong"
|
|
2685
2870
|
* ```
|
|
2686
2871
|
*
|
|
2687
|
-
* @see {@link sandbox} to expose failures as full causes.
|
|
2688
|
-
*
|
|
2689
2872
|
* @category error handling
|
|
2690
2873
|
* @since 2.0.0
|
|
2691
2874
|
*/
|
|
@@ -2695,9 +2878,8 @@ export const sandbox = internal.sandbox;
|
|
|
2695
2878
|
*
|
|
2696
2879
|
* **When to use**
|
|
2697
2880
|
*
|
|
2698
|
-
*
|
|
2699
|
-
*
|
|
2700
|
-
* effects of the effect and do not need to handle or process its outcome.
|
|
2881
|
+
* Use when an effect should run for its side effects while both success and
|
|
2882
|
+
* failure values are discarded.
|
|
2701
2883
|
*
|
|
2702
2884
|
* Use the `log` option to emit the full {@link Cause} when the effect fails,
|
|
2703
2885
|
* and `message` to prepend a custom log message.
|
|
@@ -2755,7 +2937,7 @@ export const ignore = internal.ignore;
|
|
|
2755
2937
|
*/
|
|
2756
2938
|
export const ignoreCause = internal.ignoreCause;
|
|
2757
2939
|
/**
|
|
2758
|
-
*
|
|
2940
|
+
* Applies an `ExecutionPlan` to an effect, retrying with step-provided resources
|
|
2759
2941
|
* until it succeeds or the plan is exhausted.
|
|
2760
2942
|
*
|
|
2761
2943
|
* **Details**
|
|
@@ -2787,7 +2969,7 @@ export const ignoreCause = internal.ignoreCause;
|
|
|
2787
2969
|
* const program = Effect.withExecutionPlan(fetchUrl, plan)
|
|
2788
2970
|
* ```
|
|
2789
2971
|
*
|
|
2790
|
-
* @category
|
|
2972
|
+
* @category fallback
|
|
2791
2973
|
* @since 3.16.0
|
|
2792
2974
|
*/
|
|
2793
2975
|
export const withExecutionPlan = internalExecutionPlan.withExecutionPlan;
|
|
@@ -2839,7 +3021,7 @@ export const withErrorReporting = internal.withErrorReporting;
|
|
|
2839
3021
|
* // { _id: 'Exit', _tag: 'Success', value: 18 }
|
|
2840
3022
|
* ```
|
|
2841
3023
|
*
|
|
2842
|
-
* @category
|
|
3024
|
+
* @category fallback
|
|
2843
3025
|
* @since 2.0.0
|
|
2844
3026
|
*/
|
|
2845
3027
|
export const orElseSucceed = internal.orElseSucceed;
|
|
@@ -2849,7 +3031,7 @@ export const orElseSucceed = internal.orElseSucceed;
|
|
|
2849
3031
|
*
|
|
2850
3032
|
* **When to use**
|
|
2851
3033
|
*
|
|
2852
|
-
* Use
|
|
3034
|
+
* Use when you have prioritized fallback strategies, such as
|
|
2853
3035
|
* attempting multiple APIs, reading configuration from several sources, or
|
|
2854
3036
|
* trying alternative resource locations in order.
|
|
2855
3037
|
*
|
|
@@ -2884,7 +3066,7 @@ export const orElseSucceed = internal.orElseSucceed;
|
|
|
2884
3066
|
* // Output: "secondary result"
|
|
2885
3067
|
* ```
|
|
2886
3068
|
*
|
|
2887
|
-
* @category
|
|
3069
|
+
* @category fallback
|
|
2888
3070
|
* @since 2.0.0
|
|
2889
3071
|
*/
|
|
2890
3072
|
export const firstSuccessOf = internal.firstSuccessOf;
|
|
@@ -2895,6 +3077,12 @@ export const firstSuccessOf = internal.firstSuccessOf;
|
|
|
2895
3077
|
* Adds a time limit to an effect, triggering a timeout if the effect exceeds
|
|
2896
3078
|
* the duration.
|
|
2897
3079
|
*
|
|
3080
|
+
* **When to use**
|
|
3081
|
+
*
|
|
3082
|
+
* Use when exceeding the time limit should be represented as a typed
|
|
3083
|
+
* failure. Use `timeoutOption` when a timeout should become `Option.none`, and
|
|
3084
|
+
* `timeoutOrElse` when you want to run a fallback effect.
|
|
3085
|
+
*
|
|
2898
3086
|
* **Details**
|
|
2899
3087
|
*
|
|
2900
3088
|
* The `timeout` function allows you to specify a time limit for an
|
|
@@ -2903,6 +3091,10 @@ export const firstSuccessOf = internal.firstSuccessOf;
|
|
|
2903
3091
|
* your program waits for a task to finish, ensuring that it doesn't hang
|
|
2904
3092
|
* indefinitely if the task takes too long.
|
|
2905
3093
|
*
|
|
3094
|
+
* **Gotchas**
|
|
3095
|
+
*
|
|
3096
|
+
* If the timeout wins, the source effect is interrupted.
|
|
3097
|
+
*
|
|
2906
3098
|
* **Example** (Failing when work takes too long)
|
|
2907
3099
|
*
|
|
2908
3100
|
* ```ts
|
|
@@ -2933,8 +3125,10 @@ export const firstSuccessOf = internal.firstSuccessOf;
|
|
|
2933
3125
|
* // }
|
|
2934
3126
|
* ```
|
|
2935
3127
|
*
|
|
3128
|
+
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
2936
3129
|
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
2937
|
-
*
|
|
3130
|
+
*
|
|
3131
|
+
* @category delays & timeouts
|
|
2938
3132
|
* @since 2.0.0
|
|
2939
3133
|
*/
|
|
2940
3134
|
export const timeout = internal.timeout;
|
|
@@ -2942,6 +3136,12 @@ export const timeout = internal.timeout;
|
|
|
2942
3136
|
* Runs an effect with a time limit and represents only the timeout case as
|
|
2943
3137
|
* `Option.none`.
|
|
2944
3138
|
*
|
|
3139
|
+
* **When to use**
|
|
3140
|
+
*
|
|
3141
|
+
* Use when a timeout should be handled as absence. Use
|
|
3142
|
+
* `timeout` when a timeout should fail the effect, and `timeoutOrElse` when
|
|
3143
|
+
* you want to run a fallback effect.
|
|
3144
|
+
*
|
|
2945
3145
|
* **Details**
|
|
2946
3146
|
*
|
|
2947
3147
|
* If the source effect succeeds before the timeout, the returned effect
|
|
@@ -2949,9 +3149,6 @@ export const timeout = internal.timeout;
|
|
|
2949
3149
|
* interrupted and the returned effect succeeds with `Option.none`. If the
|
|
2950
3150
|
* source effect fails before the timeout, that failure is preserved.
|
|
2951
3151
|
*
|
|
2952
|
-
* @see {@link timeout} for a version that raises a `TimeoutException`.
|
|
2953
|
-
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
2954
|
-
*
|
|
2955
3152
|
* **Example** (Returning None on timeout)
|
|
2956
3153
|
*
|
|
2957
3154
|
* ```ts
|
|
@@ -2980,17 +3177,31 @@ export const timeout = internal.timeout;
|
|
|
2980
3177
|
* // ]
|
|
2981
3178
|
* ```
|
|
2982
3179
|
*
|
|
2983
|
-
* @
|
|
3180
|
+
* @see {@link timeout} for a version that raises a `TimeoutException`.
|
|
3181
|
+
* @see {@link timeoutOrElse} for a version that allows specifying both success and timeout handlers.
|
|
3182
|
+
*
|
|
3183
|
+
* @category delays & timeouts
|
|
2984
3184
|
* @since 3.1.0
|
|
2985
3185
|
*/
|
|
2986
3186
|
export const timeoutOption = internal.timeoutOption;
|
|
2987
3187
|
/**
|
|
2988
3188
|
* Applies a timeout to an effect, with a fallback effect executed if the timeout is reached.
|
|
2989
3189
|
*
|
|
3190
|
+
* **When to use**
|
|
3191
|
+
*
|
|
3192
|
+
* Use when a timeout should switch to a fallback effect. Use
|
|
3193
|
+
* `timeout` when a timeout should fail the effect, and `timeoutOption` when a
|
|
3194
|
+
* timeout should become `Option.none`.
|
|
3195
|
+
*
|
|
2990
3196
|
* **Details**
|
|
2991
3197
|
*
|
|
2992
|
-
*
|
|
2993
|
-
*
|
|
3198
|
+
* The fallback effect is created lazily by `orElse` and may introduce its own
|
|
3199
|
+
* success, failure, and requirement types.
|
|
3200
|
+
*
|
|
3201
|
+
* **Gotchas**
|
|
3202
|
+
*
|
|
3203
|
+
* If the timeout wins, the source effect is interrupted before the fallback is
|
|
3204
|
+
* run.
|
|
2994
3205
|
*
|
|
2995
3206
|
* **Example** (Falling back on timeout)
|
|
2996
3207
|
*
|
|
@@ -3020,7 +3231,10 @@ export const timeoutOption = internal.timeoutOption;
|
|
|
3020
3231
|
* // Cached result
|
|
3021
3232
|
* ```
|
|
3022
3233
|
*
|
|
3023
|
-
* @
|
|
3234
|
+
* @see {@link timeout} for failing with a `TimeoutException`.
|
|
3235
|
+
* @see {@link timeoutOption} for returning `Option.none` on timeout.
|
|
3236
|
+
*
|
|
3237
|
+
* @category delays & timeouts
|
|
3024
3238
|
* @since 4.0.0
|
|
3025
3239
|
*/
|
|
3026
3240
|
export const timeoutOrElse = internal.timeoutOrElse;
|
|
@@ -3042,7 +3256,7 @@ export const timeoutOrElse = internal.timeoutOrElse;
|
|
|
3042
3256
|
* // Waits 1 second, then prints: "Delayed message"
|
|
3043
3257
|
* ```
|
|
3044
3258
|
*
|
|
3045
|
-
* @category
|
|
3259
|
+
* @category delays & timeouts
|
|
3046
3260
|
* @since 2.0.0
|
|
3047
3261
|
*/
|
|
3048
3262
|
export const delay = internal.delay;
|
|
@@ -3066,12 +3280,12 @@ export const delay = internal.delay;
|
|
|
3066
3280
|
* // Output: "End" (after 2 seconds)
|
|
3067
3281
|
* ```
|
|
3068
3282
|
*
|
|
3069
|
-
* @category
|
|
3283
|
+
* @category delays & timeouts
|
|
3070
3284
|
* @since 2.0.0
|
|
3071
3285
|
*/
|
|
3072
3286
|
export const sleep = internal.sleep;
|
|
3073
3287
|
/**
|
|
3074
|
-
*
|
|
3288
|
+
* Returns the runtime duration of an effect together with its result.
|
|
3075
3289
|
*
|
|
3076
3290
|
* **Details**
|
|
3077
3291
|
*
|
|
@@ -3089,7 +3303,7 @@ export const sleep = internal.sleep;
|
|
|
3089
3303
|
* })
|
|
3090
3304
|
* ```
|
|
3091
3305
|
*
|
|
3092
|
-
* @category
|
|
3306
|
+
* @category delays & timeouts
|
|
3093
3307
|
* @since 2.0.0
|
|
3094
3308
|
*/
|
|
3095
3309
|
export const timed = internal.timed;
|
|
@@ -3101,7 +3315,7 @@ export const timed = internal.timed;
|
|
|
3101
3315
|
*
|
|
3102
3316
|
* **When to use**
|
|
3103
3317
|
*
|
|
3104
|
-
* Use
|
|
3318
|
+
* Use when early failures should be ignored until a success occurs
|
|
3105
3319
|
* or all effects fail.
|
|
3106
3320
|
*
|
|
3107
3321
|
* **Details**
|
|
@@ -3128,7 +3342,7 @@ export const timed = internal.timed;
|
|
|
3128
3342
|
* ```
|
|
3129
3343
|
*
|
|
3130
3344
|
* @see {@link race} for a version that handles only two effects.
|
|
3131
|
-
* @category
|
|
3345
|
+
* @category racing
|
|
3132
3346
|
* @since 2.0.0
|
|
3133
3347
|
*/
|
|
3134
3348
|
export const raceAll = internal.raceAll;
|
|
@@ -3158,7 +3372,7 @@ export const raceAll = internal.raceAll;
|
|
|
3158
3372
|
* // Result: "First" (after ~200ms, even though effect2 completes first but fails)
|
|
3159
3373
|
* ```
|
|
3160
3374
|
*
|
|
3161
|
-
* @category
|
|
3375
|
+
* @category racing
|
|
3162
3376
|
* @since 4.0.0
|
|
3163
3377
|
*/
|
|
3164
3378
|
export const raceAllFirst = internal.raceAllFirst;
|
|
@@ -3187,7 +3401,7 @@ export const raceAllFirst = internal.raceAllFirst;
|
|
|
3187
3401
|
* // Output: winner: slow-success
|
|
3188
3402
|
* ```
|
|
3189
3403
|
*
|
|
3190
|
-
* @category
|
|
3404
|
+
* @category racing
|
|
3191
3405
|
* @since 2.0.0
|
|
3192
3406
|
*/
|
|
3193
3407
|
export const race = internal.race;
|
|
@@ -3219,7 +3433,7 @@ export const race = internal.race;
|
|
|
3219
3433
|
* // Output: failed: fast-fail
|
|
3220
3434
|
* ```
|
|
3221
3435
|
*
|
|
3222
|
-
* @category
|
|
3436
|
+
* @category racing
|
|
3223
3437
|
* @since 2.0.0
|
|
3224
3438
|
*/
|
|
3225
3439
|
export const raceFirst = internal.raceFirst;
|
|
@@ -3251,12 +3465,43 @@ export const filter = internal.filter;
|
|
|
3251
3465
|
/**
|
|
3252
3466
|
* Filters and maps elements of an iterable with a `Filter`.
|
|
3253
3467
|
*
|
|
3468
|
+
* **When to use**
|
|
3469
|
+
*
|
|
3470
|
+
* Use to keep only iterable elements accepted by a `Filter` and collect each
|
|
3471
|
+
* filter success value.
|
|
3472
|
+
*
|
|
3473
|
+
* **Details**
|
|
3474
|
+
*
|
|
3475
|
+
* `Result.succeed` values are collected in the returned array, and
|
|
3476
|
+
* `Result.fail` values are skipped.
|
|
3477
|
+
*
|
|
3478
|
+
* @see {@link filter} for keeping original elements with a boolean predicate, refinement, or effectful predicate
|
|
3479
|
+
* @see {@link filterMapEffect} for using an effectful `Filter`
|
|
3480
|
+
*
|
|
3254
3481
|
* @category filtering
|
|
3255
3482
|
* @since 2.0.0
|
|
3256
3483
|
*/
|
|
3257
3484
|
export const filterMap = internal.filterMap;
|
|
3258
3485
|
/**
|
|
3259
|
-
*
|
|
3486
|
+
* Filters and maps elements of an iterable effectfully with a `FilterEffect`.
|
|
3487
|
+
*
|
|
3488
|
+
* **When to use**
|
|
3489
|
+
*
|
|
3490
|
+
* Use when filtering each iterable element requires effects and accepted
|
|
3491
|
+
* elements should be transformed into successful output values.
|
|
3492
|
+
*
|
|
3493
|
+
* **Details**
|
|
3494
|
+
*
|
|
3495
|
+
* `Result.succeed` values are collected in the returned array, and
|
|
3496
|
+
* `Result.fail` values are skipped.
|
|
3497
|
+
*
|
|
3498
|
+
* **Gotchas**
|
|
3499
|
+
*
|
|
3500
|
+
* With concurrent execution, successful values are collected in completion
|
|
3501
|
+
* order, not input order.
|
|
3502
|
+
*
|
|
3503
|
+
* @see {@link filterMap} for using a synchronous `Filter`
|
|
3504
|
+
* @see {@link filter} for keeping original elements with a predicate
|
|
3260
3505
|
*
|
|
3261
3506
|
* @category filtering
|
|
3262
3507
|
* @since 4.0.0
|
|
@@ -3297,6 +3542,20 @@ export const filterOrElse = internal.filterOrElse;
|
|
|
3297
3542
|
/**
|
|
3298
3543
|
* Filters an effect with a `Filter`, providing an alternative effect on failure.
|
|
3299
3544
|
*
|
|
3545
|
+
* **When to use**
|
|
3546
|
+
*
|
|
3547
|
+
* Use when a successful effect value should be accepted and transformed by a
|
|
3548
|
+
* `Filter`, while rejected values should continue with an alternative effect
|
|
3549
|
+
* built from the filter failure.
|
|
3550
|
+
*
|
|
3551
|
+
* **Details**
|
|
3552
|
+
*
|
|
3553
|
+
* `Result.succeed` becomes the returned success value, and `Result.fail` is
|
|
3554
|
+
* passed to `orElse`.
|
|
3555
|
+
*
|
|
3556
|
+
* @see {@link filterOrElse} for using a predicate and fallback effect
|
|
3557
|
+
* @see {@link filterMapOrFail} for failing the effect when the filter fails
|
|
3558
|
+
*
|
|
3300
3559
|
* @category filtering
|
|
3301
3560
|
* @since 4.0.0
|
|
3302
3561
|
*/
|
|
@@ -3333,7 +3592,21 @@ export const filterMapOrElse = internal.filterMapOrElse;
|
|
|
3333
3592
|
*/
|
|
3334
3593
|
export const filterOrFail = internal.filterOrFail;
|
|
3335
3594
|
/**
|
|
3336
|
-
* Filters an effect with a `Filter`, failing when the filter fails.
|
|
3595
|
+
* Filters and maps an effect with a `Filter`, failing when the filter fails.
|
|
3596
|
+
*
|
|
3597
|
+
* **When to use**
|
|
3598
|
+
*
|
|
3599
|
+
* Use when validating and transforming one effect success with a synchronous
|
|
3600
|
+
* `Filter`, while rejected values should fail the effect.
|
|
3601
|
+
*
|
|
3602
|
+
* **Details**
|
|
3603
|
+
*
|
|
3604
|
+
* `Result.succeed` becomes the returned success value. `Result.fail` is mapped
|
|
3605
|
+
* with `orFailWith` when provided, or fails with `NoSuchElementError`.
|
|
3606
|
+
*
|
|
3607
|
+
* @see {@link filterMapOrElse} for continuing with a fallback effect when the filter fails
|
|
3608
|
+
* @see {@link filterOrFail} for validating with a predicate instead of a `Filter`
|
|
3609
|
+
* @see {@link filterMap} for filtering and mapping iterable elements
|
|
3337
3610
|
*
|
|
3338
3611
|
* @category filtering
|
|
3339
3612
|
* @since 4.0.0
|
|
@@ -3343,12 +3616,12 @@ export const filterMapOrFail = internal.filterMapOrFail;
|
|
|
3343
3616
|
// Conditional Operators
|
|
3344
3617
|
// -----------------------------------------------------------------------------
|
|
3345
3618
|
/**
|
|
3346
|
-
*
|
|
3619
|
+
* Runs an effect conditionally based on the result of an effectful boolean
|
|
3347
3620
|
* condition.
|
|
3348
3621
|
*
|
|
3349
3622
|
* **When to use**
|
|
3350
3623
|
*
|
|
3351
|
-
* Use
|
|
3624
|
+
* Use when an effectful check decides whether to run another effect while
|
|
3352
3625
|
* representing the skipped case explicitly.
|
|
3353
3626
|
*
|
|
3354
3627
|
* **Details**
|
|
@@ -3375,8 +3648,7 @@ export const filterMapOrFail = internal.filterMapOrFail;
|
|
|
3375
3648
|
* // { _id: 'Option', _tag: 'Some', value: undefined }
|
|
3376
3649
|
* ```
|
|
3377
3650
|
*
|
|
3378
|
-
* @
|
|
3379
|
-
* @category Conditional Operators
|
|
3651
|
+
* @category conditional operators
|
|
3380
3652
|
* @since 2.0.0
|
|
3381
3653
|
*/
|
|
3382
3654
|
export const when = internal.when;
|
|
@@ -3389,7 +3661,7 @@ export const when = internal.when;
|
|
|
3389
3661
|
*
|
|
3390
3662
|
* **When to use**
|
|
3391
3663
|
*
|
|
3392
|
-
*
|
|
3664
|
+
* Use when this is useful for structuring your code to respond differently to success or
|
|
3393
3665
|
* failure without triggering side effects.
|
|
3394
3666
|
*
|
|
3395
3667
|
* **Details**
|
|
@@ -3432,7 +3704,7 @@ export const when = internal.when;
|
|
|
3432
3704
|
* ```
|
|
3433
3705
|
*
|
|
3434
3706
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
3435
|
-
* @category
|
|
3707
|
+
* @category pattern matching
|
|
3436
3708
|
* @since 2.0.0
|
|
3437
3709
|
*/
|
|
3438
3710
|
export const match = internal.match;
|
|
@@ -3442,7 +3714,7 @@ export const match = internal.match;
|
|
|
3442
3714
|
*
|
|
3443
3715
|
* **When to use**
|
|
3444
3716
|
*
|
|
3445
|
-
* Use
|
|
3717
|
+
* Use when you need to handle both success and failure cases and want
|
|
3446
3718
|
* optimal performance for resolved effects. This is particularly useful in
|
|
3447
3719
|
* scenarios where you frequently work with already computed values.
|
|
3448
3720
|
*
|
|
@@ -3469,7 +3741,7 @@ export const match = internal.match;
|
|
|
3469
3741
|
*
|
|
3470
3742
|
* @see {@link match} for the non-eager version.
|
|
3471
3743
|
* @see {@link matchEffect} if you need to perform side effects in the handlers.
|
|
3472
|
-
* @category
|
|
3744
|
+
* @category pattern matching
|
|
3473
3745
|
* @since 4.0.0
|
|
3474
3746
|
*/
|
|
3475
3747
|
export const matchEager = internal.matchEager;
|
|
@@ -3478,7 +3750,7 @@ export const matchEager = internal.matchEager;
|
|
|
3478
3750
|
*
|
|
3479
3751
|
* **When to use**
|
|
3480
3752
|
*
|
|
3481
|
-
*
|
|
3753
|
+
* Use when this is useful for differentiating between different types of errors, such as
|
|
3482
3754
|
* regular failures, defects, or interruptions. You can provide specific
|
|
3483
3755
|
* handling logic for each failure type based on the cause.
|
|
3484
3756
|
*
|
|
@@ -3506,7 +3778,7 @@ export const matchEager = internal.matchEager;
|
|
|
3506
3778
|
* @see {@link matchCauseEffect} if you need to perform side effects in the
|
|
3507
3779
|
* handlers.
|
|
3508
3780
|
* @see {@link match} if you don't need to handle the cause of the failure.
|
|
3509
|
-
* @category
|
|
3781
|
+
* @category pattern matching
|
|
3510
3782
|
* @since 2.0.0
|
|
3511
3783
|
*/
|
|
3512
3784
|
export const matchCause = internal.matchCause;
|
|
@@ -3515,7 +3787,7 @@ export const matchCause = internal.matchCause;
|
|
|
3515
3787
|
*
|
|
3516
3788
|
* **When to use**
|
|
3517
3789
|
*
|
|
3518
|
-
*
|
|
3790
|
+
* Use when this is useful when you have effects that are likely to be already resolved
|
|
3519
3791
|
* and you want to avoid the overhead of the effect pipeline. For pending effects,
|
|
3520
3792
|
* it automatically falls back to the regular `matchCause` behavior.
|
|
3521
3793
|
*
|
|
@@ -3536,25 +3808,40 @@ export const matchCause = internal.matchCause;
|
|
|
3536
3808
|
* })
|
|
3537
3809
|
* ```
|
|
3538
3810
|
*
|
|
3539
|
-
* @category
|
|
3811
|
+
* @category pattern matching
|
|
3540
3812
|
* @since 4.0.0
|
|
3541
3813
|
*/
|
|
3542
3814
|
export const matchCauseEager = internal.matchCauseEager;
|
|
3543
3815
|
/**
|
|
3544
|
-
*
|
|
3816
|
+
* Handles success or failure eagerly with effectful handlers when the effect is already resolved.
|
|
3817
|
+
*
|
|
3818
|
+
* **When to use**
|
|
3819
|
+
*
|
|
3820
|
+
* Use when success and cause-aware failure handlers return effects and the
|
|
3821
|
+
* input may already be resolved, so the selected handler can run immediately
|
|
3822
|
+
* while unresolved inputs keep normal effectful matching behavior.
|
|
3545
3823
|
*
|
|
3546
3824
|
* **Details**
|
|
3547
3825
|
*
|
|
3548
3826
|
* If the effect is an `Exit`, the matching handler runs immediately; otherwise it behaves like
|
|
3549
3827
|
* {@link matchCauseEffect}.
|
|
3550
3828
|
*
|
|
3551
|
-
* @
|
|
3829
|
+
* @see {@link matchCauseEffect} for the non-eager effectful variant
|
|
3830
|
+
* @see {@link matchCauseEager} for eager cause matching with pure handlers
|
|
3831
|
+
* @see {@link matchEffect} for effectful matching on typed failures instead of full causes
|
|
3832
|
+
*
|
|
3833
|
+
* @category pattern matching
|
|
3552
3834
|
* @since 4.0.0
|
|
3553
3835
|
*/
|
|
3554
3836
|
export const matchCauseEffectEager = internal.matchCauseEffectEager;
|
|
3555
3837
|
/**
|
|
3556
3838
|
* Handles failures with access to the cause and allows performing side effects.
|
|
3557
3839
|
*
|
|
3840
|
+
* **When to use**
|
|
3841
|
+
*
|
|
3842
|
+
* Use when both success and failure handling must return effects and the
|
|
3843
|
+
* failure branch needs the full `Cause`.
|
|
3844
|
+
*
|
|
3558
3845
|
* **Details**
|
|
3559
3846
|
*
|
|
3560
3847
|
* The `matchCauseEffect` function works similarly to {@link matchCause}, but it
|
|
@@ -3603,7 +3890,7 @@ export const matchCauseEffectEager = internal.matchCauseEffectEager;
|
|
|
3603
3890
|
* @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.
|
|
3604
3891
|
* @see {@link matchEffect} if you don't need to handle the cause of the failure.
|
|
3605
3892
|
*
|
|
3606
|
-
* @category
|
|
3893
|
+
* @category pattern matching
|
|
3607
3894
|
* @since 2.0.0
|
|
3608
3895
|
*/
|
|
3609
3896
|
export const matchCauseEffect = internal.matchCauseEffect;
|
|
@@ -3612,7 +3899,7 @@ export const matchCauseEffect = internal.matchCauseEffect;
|
|
|
3612
3899
|
*
|
|
3613
3900
|
* **When to use**
|
|
3614
3901
|
*
|
|
3615
|
-
* Use
|
|
3902
|
+
* Use when the failure or success branch must run additional effects.
|
|
3616
3903
|
*
|
|
3617
3904
|
* **Details**
|
|
3618
3905
|
*
|
|
@@ -3663,7 +3950,7 @@ export const matchCauseEffect = internal.matchCauseEffect;
|
|
|
3663
3950
|
*
|
|
3664
3951
|
* @see {@link match} if you don't need side effects and only want to handle the
|
|
3665
3952
|
* result or failure.
|
|
3666
|
-
* @category
|
|
3953
|
+
* @category pattern matching
|
|
3667
3954
|
* @since 2.0.0
|
|
3668
3955
|
*/
|
|
3669
3956
|
export const matchEffect = internal.matchEffect;
|
|
@@ -3691,7 +3978,7 @@ export const matchEffect = internal.matchEffect;
|
|
|
3691
3978
|
* // Output: true
|
|
3692
3979
|
* ```
|
|
3693
3980
|
*
|
|
3694
|
-
* @category
|
|
3981
|
+
* @category condition checking
|
|
3695
3982
|
* @since 2.0.0
|
|
3696
3983
|
*/
|
|
3697
3984
|
export const isFailure = internal.isFailure;
|
|
@@ -3721,7 +4008,7 @@ export const isFailure = internal.isFailure;
|
|
|
3721
4008
|
* // failed: false
|
|
3722
4009
|
* ```
|
|
3723
4010
|
*
|
|
3724
|
-
* @category
|
|
4011
|
+
* @category condition checking
|
|
3725
4012
|
* @since 2.0.0
|
|
3726
4013
|
*/
|
|
3727
4014
|
export const isSuccess = internal.isSuccess;
|
|
@@ -3731,6 +4018,10 @@ export const isSuccess = internal.isSuccess;
|
|
|
3731
4018
|
/**
|
|
3732
4019
|
* Returns the complete context.
|
|
3733
4020
|
*
|
|
4021
|
+
* **When to use**
|
|
4022
|
+
*
|
|
4023
|
+
* Use to read the complete `Context` available to the current effect.
|
|
4024
|
+
*
|
|
3734
4025
|
* **Details**
|
|
3735
4026
|
*
|
|
3736
4027
|
* This function allows you to access all services that are currently available
|
|
@@ -3766,13 +4057,20 @@ export const isSuccess = internal.isSuccess;
|
|
|
3766
4057
|
* const provided = Effect.provideContext(program, context)
|
|
3767
4058
|
* ```
|
|
3768
4059
|
*
|
|
3769
|
-
* @
|
|
4060
|
+
* @see {@link contextWith} for deriving an effect from the complete context
|
|
4061
|
+
* @see {@link service} for reading one service from the context
|
|
4062
|
+
*
|
|
4063
|
+
* @category environment
|
|
3770
4064
|
* @since 2.0.0
|
|
3771
4065
|
*/
|
|
3772
4066
|
export const context = internal.context;
|
|
3773
4067
|
/**
|
|
3774
4068
|
* Transforms the current context using the provided function.
|
|
3775
4069
|
*
|
|
4070
|
+
* **When to use**
|
|
4071
|
+
*
|
|
4072
|
+
* Use to derive an effect from the complete `Context`.
|
|
4073
|
+
*
|
|
3776
4074
|
* **Details**
|
|
3777
4075
|
*
|
|
3778
4076
|
* This function allows you to access the complete context and perform
|
|
@@ -3814,7 +4112,10 @@ export const context = internal.context;
|
|
|
3814
4112
|
* })
|
|
3815
4113
|
* ```
|
|
3816
4114
|
*
|
|
3817
|
-
* @
|
|
4115
|
+
* @see {@link context} for reading the complete context as a value
|
|
4116
|
+
* @see {@link service} for reading one service from the context
|
|
4117
|
+
*
|
|
4118
|
+
* @category environment
|
|
3818
4119
|
* @since 2.0.0
|
|
3819
4120
|
*/
|
|
3820
4121
|
export const contextWith = internal.contextWith;
|
|
@@ -3849,7 +4150,7 @@ export const contextWith = internal.contextWith;
|
|
|
3849
4150
|
* // Output: "Result for: SELECT * FROM users"
|
|
3850
4151
|
* ```
|
|
3851
4152
|
*
|
|
3852
|
-
* @category
|
|
4153
|
+
* @category environment
|
|
3853
4154
|
* @since 2.0.0
|
|
3854
4155
|
*/
|
|
3855
4156
|
export const provide = internalLayer.provide;
|
|
@@ -3890,7 +4191,7 @@ export const provide = internalLayer.provide;
|
|
|
3890
4191
|
* const provided = Effect.provideContext(program, context)
|
|
3891
4192
|
* ```
|
|
3892
4193
|
*
|
|
3893
|
-
* @category
|
|
4194
|
+
* @category environment
|
|
3894
4195
|
* @since 4.0.0
|
|
3895
4196
|
*/
|
|
3896
4197
|
export const provideContext = internal.provideContext;
|
|
@@ -3914,13 +4215,18 @@ export const provideContext = internal.provideContext;
|
|
|
3914
4215
|
* })
|
|
3915
4216
|
* ```
|
|
3916
4217
|
*
|
|
3917
|
-
* @category
|
|
4218
|
+
* @category context
|
|
3918
4219
|
* @since 4.0.0
|
|
3919
4220
|
*/
|
|
3920
4221
|
export const service = internal.service;
|
|
3921
4222
|
/**
|
|
3922
4223
|
* Optionally accesses a service from the environment.
|
|
3923
4224
|
*
|
|
4225
|
+
* **When to use**
|
|
4226
|
+
*
|
|
4227
|
+
* Use to read an optional dependency from the current context without making
|
|
4228
|
+
* that dependency part of the effect's required environment.
|
|
4229
|
+
*
|
|
3924
4230
|
* **Details**
|
|
3925
4231
|
*
|
|
3926
4232
|
* This function attempts to access a service from the environment. If the
|
|
@@ -3950,7 +4256,7 @@ export const service = internal.service;
|
|
|
3950
4256
|
* })
|
|
3951
4257
|
* ```
|
|
3952
4258
|
*
|
|
3953
|
-
* @category
|
|
4259
|
+
* @category context
|
|
3954
4260
|
* @since 2.0.0
|
|
3955
4261
|
*/
|
|
3956
4262
|
export const serviceOption = internal.serviceOption;
|
|
@@ -3992,7 +4298,7 @@ export const serviceOption = internal.serviceOption;
|
|
|
3992
4298
|
* })
|
|
3993
4299
|
* ```
|
|
3994
4300
|
*
|
|
3995
|
-
* @category
|
|
4301
|
+
* @category context
|
|
3996
4302
|
* @since 4.0.0
|
|
3997
4303
|
*/
|
|
3998
4304
|
export const updateContext = internal.updateContext;
|
|
@@ -4028,21 +4334,21 @@ export const updateContext = internal.updateContext;
|
|
|
4028
4334
|
* // 1
|
|
4029
4335
|
* ```
|
|
4030
4336
|
*
|
|
4031
|
-
* @category
|
|
4337
|
+
* @category context
|
|
4032
4338
|
* @since 2.0.0
|
|
4033
4339
|
*/
|
|
4034
4340
|
export const updateService = internal.updateService;
|
|
4035
4341
|
/**
|
|
4036
|
-
*
|
|
4037
|
-
*
|
|
4342
|
+
* Provides one concrete service implementation to an effect.
|
|
4343
|
+
*
|
|
4344
|
+
* **When to use**
|
|
4345
|
+
*
|
|
4346
|
+
* Use to satisfy one service requirement with an already-built implementation.
|
|
4038
4347
|
*
|
|
4039
4348
|
* **Details**
|
|
4040
4349
|
*
|
|
4041
|
-
*
|
|
4042
|
-
*
|
|
4043
|
-
* number generator), and then you use `provideService` to link that
|
|
4044
|
-
* service to its implementation. Once the implementation is provided, the
|
|
4045
|
-
* effect can be run successfully without further requirements.
|
|
4350
|
+
* The service requirement identified by the `Context.Key` is removed from the
|
|
4351
|
+
* effect requirements after the implementation is provided.
|
|
4046
4352
|
*
|
|
4047
4353
|
* **Example** (Providing a service value)
|
|
4048
4354
|
*
|
|
@@ -4076,7 +4382,9 @@ export const updateService = internal.updateService;
|
|
|
4076
4382
|
* ```
|
|
4077
4383
|
*
|
|
4078
4384
|
* @see {@link provide} for providing multiple layers to an effect.
|
|
4079
|
-
* @
|
|
4385
|
+
* @see {@link provideServiceEffect} for acquiring the service implementation effectfully.
|
|
4386
|
+
* @see {@link provideContext} for providing a complete context.
|
|
4387
|
+
* @category context
|
|
4080
4388
|
* @since 2.0.0
|
|
4081
4389
|
*/
|
|
4082
4390
|
export const provideService = internal.provideService;
|
|
@@ -4130,7 +4438,7 @@ export const provideService = internal.provideService;
|
|
|
4130
4438
|
* // Result for: SELECT * FROM users
|
|
4131
4439
|
* ```
|
|
4132
4440
|
*
|
|
4133
|
-
* @category
|
|
4441
|
+
* @category context
|
|
4134
4442
|
* @since 2.0.0
|
|
4135
4443
|
*/
|
|
4136
4444
|
export const provideServiceEffect = internal.provideServiceEffect;
|
|
@@ -4207,9 +4515,16 @@ export const withConcurrency = internal.withConcurrency;
|
|
|
4207
4515
|
*/
|
|
4208
4516
|
export const scope = internal.scope;
|
|
4209
4517
|
/**
|
|
4210
|
-
*
|
|
4211
|
-
*
|
|
4212
|
-
*
|
|
4518
|
+
* Runs an effect with a scope that closes when the effect completes.
|
|
4519
|
+
*
|
|
4520
|
+
* **When to use**
|
|
4521
|
+
*
|
|
4522
|
+
* Use to acquire scoped resources for the duration of a single workflow.
|
|
4523
|
+
*
|
|
4524
|
+
* **Details**
|
|
4525
|
+
*
|
|
4526
|
+
* Finalizers for resources acquired inside the workflow run as soon as the
|
|
4527
|
+
* workflow completes, whether by success, failure, or interruption.
|
|
4213
4528
|
*
|
|
4214
4529
|
* **Example** (Running a scoped acquisition)
|
|
4215
4530
|
*
|
|
@@ -4283,6 +4598,10 @@ export const scopedWith = internal.scopedWith;
|
|
|
4283
4598
|
* Constructs a scoped resource from an acquisition effect and a release
|
|
4284
4599
|
* finalizer.
|
|
4285
4600
|
*
|
|
4601
|
+
* **When to use**
|
|
4602
|
+
*
|
|
4603
|
+
* Use to acquire a scoped resource with an explicit release finalizer.
|
|
4604
|
+
*
|
|
4286
4605
|
* **Details**
|
|
4287
4606
|
*
|
|
4288
4607
|
* If acquisition succeeds, the release finalizer is added to the current scope
|
|
@@ -4330,13 +4649,20 @@ export const scopedWith = internal.scopedWith;
|
|
|
4330
4649
|
* )
|
|
4331
4650
|
* ```
|
|
4332
4651
|
*
|
|
4652
|
+
* @see {@link acquireDisposable} for resources that implement JavaScript disposal protocols
|
|
4653
|
+
* @see {@link acquireUseRelease} for bracketing acquire, use, and release in one effect
|
|
4654
|
+
*
|
|
4333
4655
|
* @category resource management
|
|
4334
4656
|
* @since 2.0.0
|
|
4335
4657
|
*/
|
|
4336
4658
|
export const acquireRelease = internal.acquireRelease;
|
|
4337
4659
|
/**
|
|
4338
|
-
*
|
|
4339
|
-
*
|
|
4660
|
+
* Acquires a scoped resource that implements JavaScript disposal protocols.
|
|
4661
|
+
*
|
|
4662
|
+
* **When to use**
|
|
4663
|
+
*
|
|
4664
|
+
* Use with JavaScript `Disposable` or `AsyncDisposable` resources that should
|
|
4665
|
+
* be closed with the surrounding scope.
|
|
4340
4666
|
*
|
|
4341
4667
|
* **Details**
|
|
4342
4668
|
*
|
|
@@ -4346,8 +4672,9 @@ export const acquireRelease = internal.acquireRelease;
|
|
|
4346
4672
|
* disposables.
|
|
4347
4673
|
*
|
|
4348
4674
|
* This is similar to {@link acquireRelease}, but uses the standard
|
|
4349
|
-
* JavaScript disposal
|
|
4350
|
-
* function.
|
|
4675
|
+
* JavaScript disposal protocol instead of requiring an explicit release
|
|
4676
|
+
* function. It works with JavaScript `Disposable` and `AsyncDisposable`
|
|
4677
|
+
* resources.
|
|
4351
4678
|
*
|
|
4352
4679
|
* **Example** (Acquiring a disposable resource)
|
|
4353
4680
|
*
|
|
@@ -4369,16 +4696,18 @@ export const acquireRelease = internal.acquireRelease;
|
|
|
4369
4696
|
* )
|
|
4370
4697
|
* ```
|
|
4371
4698
|
*
|
|
4372
|
-
* @see
|
|
4699
|
+
* @see {@link acquireRelease} for resources that need an explicit finalizer
|
|
4700
|
+
*
|
|
4373
4701
|
* @category resource management
|
|
4374
4702
|
* @since 4.0.0
|
|
4375
4703
|
*/
|
|
4376
4704
|
export const acquireDisposable = internal.acquireDisposable;
|
|
4377
4705
|
/**
|
|
4378
|
-
*
|
|
4379
|
-
*
|
|
4380
|
-
*
|
|
4381
|
-
*
|
|
4706
|
+
* Runs resource acquisition, usage, and release as one bracketed effect.
|
|
4707
|
+
*
|
|
4708
|
+
* **When to use**
|
|
4709
|
+
*
|
|
4710
|
+
* Use to bracket acquire, use, and release logic in one effect.
|
|
4382
4711
|
*
|
|
4383
4712
|
* **Details**
|
|
4384
4713
|
*
|
|
@@ -4445,20 +4774,23 @@ export const acquireDisposable = internal.acquireDisposable;
|
|
|
4445
4774
|
* // Closing connection to db://localhost:5432 (success)
|
|
4446
4775
|
* ```
|
|
4447
4776
|
*
|
|
4777
|
+
* @see {@link acquireRelease} for scoped resources whose use happens later
|
|
4778
|
+
*
|
|
4448
4779
|
* @category resource management
|
|
4449
4780
|
* @since 2.0.0
|
|
4450
4781
|
*/
|
|
4451
4782
|
export const acquireUseRelease = internal.acquireUseRelease;
|
|
4452
4783
|
/**
|
|
4453
|
-
*
|
|
4454
|
-
*
|
|
4455
|
-
*
|
|
4784
|
+
* Adds a finalizer to the current scope.
|
|
4785
|
+
*
|
|
4786
|
+
* **When to use**
|
|
4787
|
+
*
|
|
4788
|
+
* Use to register low-level cleanup in the current scope.
|
|
4456
4789
|
*
|
|
4457
4790
|
* **Details**
|
|
4458
4791
|
*
|
|
4459
|
-
*
|
|
4460
|
-
*
|
|
4461
|
-
* cleanup, logging, or other side effects that should always occur.
|
|
4792
|
+
* The finalizer runs when the surrounding scope is closed and receives the
|
|
4793
|
+
* `Exit` value used to close the scope.
|
|
4462
4794
|
*
|
|
4463
4795
|
* **Example** (Registering scope finalizers)
|
|
4464
4796
|
*
|
|
@@ -4490,6 +4822,9 @@ export const acquireUseRelease = internal.acquireUseRelease;
|
|
|
4490
4822
|
* // operation result
|
|
4491
4823
|
* ```
|
|
4492
4824
|
*
|
|
4825
|
+
* @see {@link acquireRelease} for resource acquisition with a release finalizer
|
|
4826
|
+
* @see {@link ensuring} for attaching a finalizer to one effect
|
|
4827
|
+
*
|
|
4493
4828
|
* @category resource management
|
|
4494
4829
|
* @since 2.0.0
|
|
4495
4830
|
*/
|
|
@@ -4593,6 +4928,16 @@ export const onErrorIf = internal.onErrorIf;
|
|
|
4593
4928
|
/**
|
|
4594
4929
|
* Runs the finalizer only when this effect fails and the cause matches the provided `Filter`.
|
|
4595
4930
|
*
|
|
4931
|
+
* **When to use**
|
|
4932
|
+
*
|
|
4933
|
+
* Use when cleanup or diagnostics should run only for failures whose full
|
|
4934
|
+
* `Cause` is accepted or transformed by a `Filter`, and the finalizer needs the
|
|
4935
|
+
* filter's pass value plus the original cause.
|
|
4936
|
+
*
|
|
4937
|
+
* @see {@link onError} for cleanup on every failure
|
|
4938
|
+
* @see {@link onErrorIf} for selecting failures with a boolean predicate
|
|
4939
|
+
* @see {@link onExitFilter} for selecting from every exit instead of only failures
|
|
4940
|
+
*
|
|
4596
4941
|
* @category resource management
|
|
4597
4942
|
* @since 4.0.0
|
|
4598
4943
|
*/
|
|
@@ -4601,18 +4946,26 @@ export const onErrorFilter = internal.onErrorFilter;
|
|
|
4601
4946
|
* Runs an optional finalizer with the effect's `Exit` value when the effect
|
|
4602
4947
|
* completes.
|
|
4603
4948
|
*
|
|
4949
|
+
* **When to use**
|
|
4950
|
+
*
|
|
4951
|
+
* Use when you are building a low-level `Effect` operator that must inspect the
|
|
4952
|
+
* source effect's `Exit`, may skip finalization by returning `undefined`, or
|
|
4953
|
+
* must choose whether finalization is forced into an uninterruptible region.
|
|
4954
|
+
*
|
|
4604
4955
|
* **Details**
|
|
4605
4956
|
*
|
|
4606
4957
|
* This low-level operator preserves the source effect's result unless the
|
|
4607
4958
|
* finalizer fails. Prefer `onExit` for normal cleanup logic.
|
|
4608
4959
|
*
|
|
4960
|
+
* @see {@link onExit} for ordinary exit-aware cleanup whose finalizer always returns an effect
|
|
4961
|
+
*
|
|
4609
4962
|
* @category resource management
|
|
4610
4963
|
* @since 4.0.0
|
|
4611
4964
|
*/
|
|
4612
4965
|
export const onExitPrimitive = internal.onExitPrimitive;
|
|
4613
4966
|
/**
|
|
4614
|
-
* Ensures that a cleanup
|
|
4615
|
-
*
|
|
4967
|
+
* Ensures that a cleanup function runs whether this effect succeeds, fails, or
|
|
4968
|
+
* is interrupted.
|
|
4616
4969
|
*
|
|
4617
4970
|
* **Example** (Observing every exit)
|
|
4618
4971
|
*
|
|
@@ -4664,6 +5017,21 @@ export const onExitIf = internal.onExitIf;
|
|
|
4664
5017
|
/**
|
|
4665
5018
|
* Runs the cleanup effect only when the `Exit` matches the provided `Filter`.
|
|
4666
5019
|
*
|
|
5020
|
+
* **When to use**
|
|
5021
|
+
*
|
|
5022
|
+
* Use when cleanup should run only for `Exit` values selected by a `Filter`,
|
|
5023
|
+
* and the cleanup needs the extracted pass value together with the original
|
|
5024
|
+
* `Exit`.
|
|
5025
|
+
*
|
|
5026
|
+
* **Details**
|
|
5027
|
+
*
|
|
5028
|
+
* `Result.fail` skips cleanup, and `Result.succeed` runs cleanup with the
|
|
5029
|
+
* selected value and the original `Exit`.
|
|
5030
|
+
*
|
|
5031
|
+
* @see {@link onExit} for cleanup on every exit
|
|
5032
|
+
* @see {@link onExitIf} for selecting exits with a boolean predicate
|
|
5033
|
+
* @see {@link onErrorFilter} for selecting only failure causes
|
|
5034
|
+
*
|
|
4667
5035
|
* @category resource management
|
|
4668
5036
|
* @since 4.0.0
|
|
4669
5037
|
*/
|
|
@@ -4677,7 +5045,7 @@ export const onExitFilter = internal.onExitFilter;
|
|
|
4677
5045
|
*
|
|
4678
5046
|
* **When to use**
|
|
4679
5047
|
*
|
|
4680
|
-
* Use this function when you have an expensive or time-consuming operation that
|
|
5048
|
+
* Use when you use this function when you have an expensive or time-consuming operation that
|
|
4681
5049
|
* you want to avoid repeating. The first evaluation will compute the result,
|
|
4682
5050
|
* and all following evaluations will immediately return the cached value,
|
|
4683
5051
|
* improving performance and reducing unnecessary work.
|
|
@@ -4731,7 +5099,7 @@ export const onExitFilter = internal.onExitFilter;
|
|
|
4731
5099
|
* time-to-live duration for the cached value.
|
|
4732
5100
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
4733
5101
|
* additional effect for manually invalidating the cached value.
|
|
4734
|
-
* @category
|
|
5102
|
+
* @category caching
|
|
4735
5103
|
* @since 2.0.0
|
|
4736
5104
|
*/
|
|
4737
5105
|
export const cached = internal.cached;
|
|
@@ -4741,7 +5109,7 @@ export const cached = internal.cached;
|
|
|
4741
5109
|
*
|
|
4742
5110
|
* **When to use**
|
|
4743
5111
|
*
|
|
4744
|
-
* Use this function when you have an effect that involves costly operations or
|
|
5112
|
+
* Use when you use this function when you have an effect that involves costly operations or
|
|
4745
5113
|
* computations, and you want to avoid repeating them within a short time frame.
|
|
4746
5114
|
*
|
|
4747
5115
|
* It's ideal for scenarios where the result of an effect doesn't change
|
|
@@ -4798,23 +5166,19 @@ export const cached = internal.cached;
|
|
|
4798
5166
|
* indefinitely.
|
|
4799
5167
|
* @see {@link cachedInvalidateWithTTL} for a similar function that includes an
|
|
4800
5168
|
* additional effect for manually invalidating the cached value.
|
|
4801
|
-
* @category
|
|
5169
|
+
* @category caching
|
|
4802
5170
|
* @since 2.0.0
|
|
4803
5171
|
*/
|
|
4804
5172
|
export const cachedWithTTL = internal.cachedWithTTL;
|
|
4805
5173
|
/**
|
|
4806
|
-
*
|
|
5174
|
+
* Creates a cached effect result for a specified duration and allows manual
|
|
4807
5175
|
* invalidation before expiration.
|
|
4808
5176
|
*
|
|
4809
5177
|
* **When to use**
|
|
4810
5178
|
*
|
|
4811
|
-
* Use
|
|
4812
|
-
*
|
|
4813
|
-
*
|
|
4814
|
-
*
|
|
4815
|
-
* This is useful when you need to ensure that the cached data remains valid for
|
|
4816
|
-
* a certain period but still want to invalidate it if the underlying data
|
|
4817
|
-
* changes or if you want to force a recomputation.
|
|
5179
|
+
* Use when an effect result should be cached for a bounded time and callers
|
|
5180
|
+
* also need a manual invalidation effect to force recomputation before
|
|
5181
|
+
* expiration.
|
|
4818
5182
|
*
|
|
4819
5183
|
* **Details**
|
|
4820
5184
|
*
|
|
@@ -4868,7 +5232,7 @@ export const cachedWithTTL = internal.cachedWithTTL;
|
|
|
4868
5232
|
* indefinitely.
|
|
4869
5233
|
* @see {@link cachedWithTTL} for a similar function that caches the result for
|
|
4870
5234
|
* a specified duration but does not include an effect for manual invalidation.
|
|
4871
|
-
* @category
|
|
5235
|
+
* @category caching
|
|
4872
5236
|
* @since 2.0.0
|
|
4873
5237
|
*/
|
|
4874
5238
|
export const cachedInvalidateWithTTL = internal.cachedInvalidateWithTTL;
|
|
@@ -4892,7 +5256,7 @@ export const cachedInvalidateWithTTL = internal.cachedInvalidateWithTTL;
|
|
|
4892
5256
|
* // Throws: InterruptedException
|
|
4893
5257
|
* ```
|
|
4894
5258
|
*
|
|
4895
|
-
* @category
|
|
5259
|
+
* @category interruption
|
|
4896
5260
|
* @since 2.0.0
|
|
4897
5261
|
*/
|
|
4898
5262
|
export const interrupt = internal.interrupt;
|
|
@@ -4913,7 +5277,7 @@ export const interrupt = internal.interrupt;
|
|
|
4913
5277
|
* // Later: fiber.interrupt()
|
|
4914
5278
|
* ```
|
|
4915
5279
|
*
|
|
4916
|
-
* @category
|
|
5280
|
+
* @category interruption
|
|
4917
5281
|
* @since 2.0.0
|
|
4918
5282
|
*/
|
|
4919
5283
|
export const interruptible = internal.interruptible;
|
|
@@ -4938,7 +5302,7 @@ export const interruptible = internal.interruptible;
|
|
|
4938
5302
|
* // Output: Task was interrupted, cleaning up...
|
|
4939
5303
|
* ```
|
|
4940
5304
|
*
|
|
4941
|
-
* @category
|
|
5305
|
+
* @category interruption
|
|
4942
5306
|
* @since 2.0.0
|
|
4943
5307
|
*/
|
|
4944
5308
|
export const onInterrupt = internal.onInterrupt;
|
|
@@ -4963,7 +5327,7 @@ export const onInterrupt = internal.onInterrupt;
|
|
|
4963
5327
|
* Effect.runPromise(Fiber.interrupt(fiber))
|
|
4964
5328
|
* ```
|
|
4965
5329
|
*
|
|
4966
|
-
* @category
|
|
5330
|
+
* @category interruption
|
|
4967
5331
|
* @since 2.0.0
|
|
4968
5332
|
*/
|
|
4969
5333
|
export const uninterruptible = internal.uninterruptible;
|
|
@@ -4994,14 +5358,13 @@ export const uninterruptible = internal.uninterruptible;
|
|
|
4994
5358
|
* )
|
|
4995
5359
|
* ```
|
|
4996
5360
|
*
|
|
4997
|
-
* @category
|
|
5361
|
+
* @category interruption
|
|
4998
5362
|
* @since 2.0.0
|
|
4999
5363
|
*/
|
|
5000
5364
|
export const uninterruptibleMask = internal.uninterruptibleMask;
|
|
5001
5365
|
/**
|
|
5002
|
-
*
|
|
5003
|
-
*
|
|
5004
|
-
* of any specific region of code.
|
|
5366
|
+
* Runs an effect in an interruptible region while providing `restore` for
|
|
5367
|
+
* locally restoring the previous interruptibility.
|
|
5005
5368
|
*
|
|
5006
5369
|
* **Example** (Controlling interruptibility locally)
|
|
5007
5370
|
*
|
|
@@ -5026,14 +5389,32 @@ export const uninterruptibleMask = internal.uninterruptibleMask;
|
|
|
5026
5389
|
* )
|
|
5027
5390
|
* ```
|
|
5028
5391
|
*
|
|
5029
|
-
* @category
|
|
5392
|
+
* @category interruption
|
|
5030
5393
|
* @since 2.0.0
|
|
5031
5394
|
*/
|
|
5032
5395
|
export const interruptibleMask = internal.interruptibleMask;
|
|
5033
5396
|
/**
|
|
5034
5397
|
* Creates an AbortSignal that is managed by the provided scope.
|
|
5035
5398
|
*
|
|
5036
|
-
*
|
|
5399
|
+
* **When to use**
|
|
5400
|
+
*
|
|
5401
|
+
* Use to obtain a scope-managed `AbortSignal` for APIs that accept cancellation
|
|
5402
|
+
* through a signal.
|
|
5403
|
+
*
|
|
5404
|
+
* **Details**
|
|
5405
|
+
*
|
|
5406
|
+
* Each acquisition creates a fresh `AbortController`. Closing the owning scope
|
|
5407
|
+
* runs a finalizer that aborts the controller and the effect succeeds with the
|
|
5408
|
+
* controller's signal.
|
|
5409
|
+
*
|
|
5410
|
+
* **Gotchas**
|
|
5411
|
+
*
|
|
5412
|
+
* The signal is aborted when its owning scope closes, so avoid keeping it for
|
|
5413
|
+
* work that outlives that scope.
|
|
5414
|
+
*
|
|
5415
|
+
* @see {@link scoped} for binding resource lifetime to a scope
|
|
5416
|
+
*
|
|
5417
|
+
* @category interruption
|
|
5037
5418
|
* @since 4.0.0
|
|
5038
5419
|
*/
|
|
5039
5420
|
export const abortSignal = internal.abortSignal;
|
|
@@ -5064,13 +5445,17 @@ export const abortSignal = internal.abortSignal;
|
|
|
5064
5445
|
* })
|
|
5065
5446
|
* ```
|
|
5066
5447
|
*
|
|
5067
|
-
* @category
|
|
5448
|
+
* @category repetition / recursion
|
|
5068
5449
|
* @since 2.0.0
|
|
5069
5450
|
*/
|
|
5070
5451
|
export const forever = internal.forever;
|
|
5071
5452
|
/**
|
|
5072
5453
|
* Repeats an effect based on a specified schedule or until the first failure.
|
|
5073
5454
|
*
|
|
5455
|
+
* **When to use**
|
|
5456
|
+
*
|
|
5457
|
+
* Use to rerun an effect after successful executions.
|
|
5458
|
+
*
|
|
5074
5459
|
* **Details**
|
|
5075
5460
|
*
|
|
5076
5461
|
* This function executes an effect repeatedly according to the given schedule.
|
|
@@ -5090,6 +5475,11 @@ export const forever = internal.forever;
|
|
|
5090
5475
|
* delays, limiting recursions, or dynamically adjusting based on the outcome of
|
|
5091
5476
|
* each execution.
|
|
5092
5477
|
*
|
|
5478
|
+
* **Gotchas**
|
|
5479
|
+
*
|
|
5480
|
+
* The source effect is always evaluated once before the schedule is stepped.
|
|
5481
|
+
* The schedule controls additional repetitions, not the initial execution.
|
|
5482
|
+
*
|
|
5093
5483
|
* **Example** (Repeating successful effects with a schedule)
|
|
5094
5484
|
*
|
|
5095
5485
|
* ```ts
|
|
@@ -5129,7 +5519,10 @@ export const forever = internal.forever;
|
|
|
5129
5519
|
* // Effect.runPromiseExit(program).then(console.log)
|
|
5130
5520
|
* ```
|
|
5131
5521
|
*
|
|
5132
|
-
* @
|
|
5522
|
+
* @see {@link retry} for failure-based repetition
|
|
5523
|
+
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
5524
|
+
*
|
|
5525
|
+
* @category repetition / recursion
|
|
5133
5526
|
* @since 2.0.0
|
|
5134
5527
|
*/
|
|
5135
5528
|
export const repeat = internalSchedule.repeat;
|
|
@@ -5172,18 +5565,27 @@ export const repeat = internalSchedule.repeat;
|
|
|
5172
5565
|
* )
|
|
5173
5566
|
* ```
|
|
5174
5567
|
*
|
|
5175
|
-
* @category
|
|
5568
|
+
* @category repetition / recursion
|
|
5176
5569
|
* @since 2.0.0
|
|
5177
5570
|
*/
|
|
5178
5571
|
export const repeatOrElse = internalSchedule.repeatOrElse;
|
|
5179
5572
|
/**
|
|
5180
5573
|
* Returns an array of `n` identical effects.
|
|
5181
5574
|
*
|
|
5575
|
+
* **When to use**
|
|
5576
|
+
*
|
|
5577
|
+
* Use to create an array containing the same effect multiple times when you
|
|
5578
|
+
* want to pass those effects to another collector or control execution
|
|
5579
|
+
* separately.
|
|
5580
|
+
*
|
|
5182
5581
|
* **Details**
|
|
5183
5582
|
*
|
|
5184
|
-
*
|
|
5583
|
+
* This only creates the array of effects. It does not run or collect them.
|
|
5185
5584
|
*
|
|
5186
|
-
* @
|
|
5585
|
+
* @see {@link all} for running the returned effects and collecting results
|
|
5586
|
+
* @see {@link replicateEffect} for repeating an effect and collecting results in one step with concurrency and discard options
|
|
5587
|
+
*
|
|
5588
|
+
* @category collecting
|
|
5187
5589
|
* @since 2.0.0
|
|
5188
5590
|
*/
|
|
5189
5591
|
export const replicate = internal.replicate;
|
|
@@ -5205,7 +5607,7 @@ export const replicate = internal.replicate;
|
|
|
5205
5607
|
* })
|
|
5206
5608
|
* ```
|
|
5207
5609
|
*
|
|
5208
|
-
* @category
|
|
5610
|
+
* @category collecting
|
|
5209
5611
|
* @since 2.0.0
|
|
5210
5612
|
*/
|
|
5211
5613
|
export const replicateEffect = internal.replicateEffect;
|
|
@@ -5213,6 +5615,11 @@ export const replicateEffect = internal.replicateEffect;
|
|
|
5213
5615
|
* Runs an effect repeatedly according to a schedule and returns the schedule's
|
|
5214
5616
|
* final output.
|
|
5215
5617
|
*
|
|
5618
|
+
* **When to use**
|
|
5619
|
+
*
|
|
5620
|
+
* Use to rerun a successful effect according to a `Schedule` when the schedule
|
|
5621
|
+
* does not need a custom initial input.
|
|
5622
|
+
*
|
|
5216
5623
|
* **Details**
|
|
5217
5624
|
*
|
|
5218
5625
|
* The schedule is first stepped with `undefined`. After each successful
|
|
@@ -5248,7 +5655,7 @@ export const replicateEffect = internal.replicateEffect;
|
|
|
5248
5655
|
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
5249
5656
|
* to depend on the result of this effect.
|
|
5250
5657
|
*
|
|
5251
|
-
* @category
|
|
5658
|
+
* @category repetition / recursion
|
|
5252
5659
|
* @since 2.0.0
|
|
5253
5660
|
*/
|
|
5254
5661
|
export const schedule = /*#__PURE__*/dual(2, (self, schedule) => scheduleFrom(self, undefined, schedule));
|
|
@@ -5286,7 +5693,7 @@ export const schedule = /*#__PURE__*/dual(2, (self, schedule) => scheduleFrom(se
|
|
|
5286
5693
|
* // Returns the schedule count
|
|
5287
5694
|
* ```
|
|
5288
5695
|
*
|
|
5289
|
-
* @category
|
|
5696
|
+
* @category repetition / recursion
|
|
5290
5697
|
* @since 2.0.0
|
|
5291
5698
|
*/
|
|
5292
5699
|
export const scheduleFrom = internalSchedule.scheduleFrom;
|
|
@@ -5546,7 +5953,7 @@ export const spanAnnotations = internal.spanAnnotations;
|
|
|
5546
5953
|
*/
|
|
5547
5954
|
export const spanLinks = internal.spanLinks;
|
|
5548
5955
|
/**
|
|
5549
|
-
*
|
|
5956
|
+
* Adds a link with the provided span to all spans in this effect.
|
|
5550
5957
|
*
|
|
5551
5958
|
* **Details**
|
|
5552
5959
|
*
|
|
@@ -5682,7 +6089,7 @@ export const makeSpanScoped = internal.makeSpanScoped;
|
|
|
5682
6089
|
*/
|
|
5683
6090
|
export const useSpan = internal.useSpan;
|
|
5684
6091
|
/**
|
|
5685
|
-
* Wraps the effect with a
|
|
6092
|
+
* Wraps the effect with a child span for tracing.
|
|
5686
6093
|
*
|
|
5687
6094
|
* **Example** (Wrapping an effect in a child span)
|
|
5688
6095
|
*
|
|
@@ -5704,7 +6111,7 @@ export const useSpan = internal.useSpan;
|
|
|
5704
6111
|
*/
|
|
5705
6112
|
export const withSpan = internal.withSpan;
|
|
5706
6113
|
/**
|
|
5707
|
-
* Wraps the effect with a
|
|
6114
|
+
* Wraps the effect with a scoped child span for tracing.
|
|
5708
6115
|
*
|
|
5709
6116
|
* **Details**
|
|
5710
6117
|
*
|
|
@@ -5754,8 +6161,11 @@ export const withParentSpan = internal.withParentSpan;
|
|
|
5754
6161
|
/**
|
|
5755
6162
|
* Executes a request using the provided resolver.
|
|
5756
6163
|
*
|
|
5757
|
-
*
|
|
5758
|
-
*
|
|
6164
|
+
* **When to use**
|
|
6165
|
+
*
|
|
6166
|
+
* Use to execute a typed `Request` through a `RequestResolver` when you want
|
|
6167
|
+
* concurrent requests made with the same resolver to be collected and completed
|
|
6168
|
+
* by resolver logic.
|
|
5759
6169
|
*
|
|
5760
6170
|
* **Example** (Executing a request through a resolver)
|
|
5761
6171
|
*
|
|
@@ -5781,17 +6191,28 @@ export const withParentSpan = internal.withParentSpan;
|
|
|
5781
6191
|
* yield* Console.log(name)
|
|
5782
6192
|
* })
|
|
5783
6193
|
* ```
|
|
6194
|
+
*
|
|
6195
|
+
* @see {@link requestUnsafe} for the low-level entry point when you already have a `Context` and need to enqueue outside an `Effect`
|
|
6196
|
+
*
|
|
6197
|
+
* @category requests & batching
|
|
6198
|
+
* @since 2.0.0
|
|
5784
6199
|
*/
|
|
5785
6200
|
export const request = internalRequest.request;
|
|
5786
6201
|
/**
|
|
5787
|
-
*
|
|
5788
|
-
*
|
|
6202
|
+
* Registers a request with a resolver and delivers the exit value via `onExit`.
|
|
6203
|
+
*
|
|
6204
|
+
* **When to use**
|
|
6205
|
+
*
|
|
6206
|
+
* Use when you already have a `Context` and need to enqueue a request outside
|
|
6207
|
+
* an `Effect` while receiving completion through `onExit`.
|
|
5789
6208
|
*
|
|
5790
6209
|
* **Details**
|
|
5791
6210
|
*
|
|
5792
6211
|
* It returns a canceler that removes the pending request entry.
|
|
5793
6212
|
*
|
|
5794
|
-
* @
|
|
6213
|
+
* @see {@link request} for the `Effect`-returning API used for normal request execution
|
|
6214
|
+
*
|
|
6215
|
+
* @category requests & batching
|
|
5795
6216
|
* @since 4.0.0
|
|
5796
6217
|
*/
|
|
5797
6218
|
export const requestUnsafe = internalRequest.requestUnsafe;
|
|
@@ -5844,7 +6265,7 @@ export const requestUnsafe = internalRequest.requestUnsafe;
|
|
|
5844
6265
|
* })
|
|
5845
6266
|
* ```
|
|
5846
6267
|
*
|
|
5847
|
-
* @category
|
|
6268
|
+
* @category supervision & fibers
|
|
5848
6269
|
* @since 4.0.0
|
|
5849
6270
|
*/
|
|
5850
6271
|
export const forkChild = internal.forkChild;
|
|
@@ -5873,7 +6294,7 @@ export const forkChild = internal.forkChild;
|
|
|
5873
6294
|
* )
|
|
5874
6295
|
* ```
|
|
5875
6296
|
*
|
|
5876
|
-
* @category
|
|
6297
|
+
* @category supervision & fibers
|
|
5877
6298
|
* @since 2.0.0
|
|
5878
6299
|
*/
|
|
5879
6300
|
export const forkIn = internal.forkIn;
|
|
@@ -5907,7 +6328,7 @@ export const forkIn = internal.forkIn;
|
|
|
5907
6328
|
* )
|
|
5908
6329
|
* ```
|
|
5909
6330
|
*
|
|
5910
|
-
* @category
|
|
6331
|
+
* @category supervision & fibers
|
|
5911
6332
|
* @since 2.0.0
|
|
5912
6333
|
*/
|
|
5913
6334
|
export const forkScoped = internal.forkScoped;
|
|
@@ -5941,7 +6362,7 @@ export const forkScoped = internal.forkScoped;
|
|
|
5941
6362
|
* })
|
|
5942
6363
|
* ```
|
|
5943
6364
|
*
|
|
5944
|
-
* @category
|
|
6365
|
+
* @category supervision & fibers
|
|
5945
6366
|
* @since 4.0.0
|
|
5946
6367
|
*/
|
|
5947
6368
|
export const forkDetach = internal.forkDetach;
|
|
@@ -5949,12 +6370,27 @@ export const forkDetach = internal.forkDetach;
|
|
|
5949
6370
|
* Waits for all child fibers forked by this effect to complete before this
|
|
5950
6371
|
* effect completes.
|
|
5951
6372
|
*
|
|
5952
|
-
*
|
|
6373
|
+
* **When to use**
|
|
6374
|
+
*
|
|
6375
|
+
* Use to let an effect start child work concurrently while still delaying its
|
|
6376
|
+
* own completion until that child work is done.
|
|
6377
|
+
*
|
|
6378
|
+
* **Gotchas**
|
|
6379
|
+
*
|
|
6380
|
+
* Child fibers that already exist before the wrapped effect starts are not
|
|
6381
|
+
* awaited.
|
|
6382
|
+
*
|
|
6383
|
+
* @see {@link forkChild} for forking child fibers that are awaited by this operator
|
|
6384
|
+
* @see {@link forkDetach} for forking fibers outside the child scope
|
|
6385
|
+
* @see {@link forkIn} for forking into an explicit scope
|
|
6386
|
+
* @see {@link forkScoped} for forking fibers tied to the current scope
|
|
6387
|
+
*
|
|
6388
|
+
* @category supervision & fibers
|
|
5953
6389
|
* @since 2.0.0
|
|
5954
6390
|
*/
|
|
5955
6391
|
export const awaitAllChildren = internal.awaitAllChildren;
|
|
5956
6392
|
/**
|
|
5957
|
-
*
|
|
6393
|
+
* Accesses the fiber currently executing the effect.
|
|
5958
6394
|
*
|
|
5959
6395
|
* **Example** (Accessing the current fiber)
|
|
5960
6396
|
*
|
|
@@ -5967,12 +6403,12 @@ export const awaitAllChildren = internal.awaitAllChildren;
|
|
|
5967
6403
|
* })
|
|
5968
6404
|
* ```
|
|
5969
6405
|
*
|
|
5970
|
-
* @category
|
|
6406
|
+
* @category supervision & fibers
|
|
5971
6407
|
* @since 4.0.0
|
|
5972
6408
|
*/
|
|
5973
6409
|
export const fiber = internal.fiber;
|
|
5974
6410
|
/**
|
|
5975
|
-
*
|
|
6411
|
+
* Accesses the current fiber id executing the effect.
|
|
5976
6412
|
*
|
|
5977
6413
|
* **Example** (Accessing the current fiber id)
|
|
5978
6414
|
*
|
|
@@ -5990,22 +6426,19 @@ export const fiber = internal.fiber;
|
|
|
5990
6426
|
* )
|
|
5991
6427
|
* ```
|
|
5992
6428
|
*
|
|
5993
|
-
* @category
|
|
6429
|
+
* @category supervision & fibers
|
|
5994
6430
|
* @since 2.0.0
|
|
5995
6431
|
*/
|
|
5996
6432
|
export const fiberId = internal.fiberId;
|
|
5997
6433
|
/**
|
|
5998
|
-
*
|
|
6434
|
+
* Runs an effect in the background, returning a fiber that can
|
|
5999
6435
|
* be observed or interrupted.
|
|
6000
6436
|
*
|
|
6001
6437
|
* **When to use**
|
|
6002
6438
|
*
|
|
6003
|
-
*
|
|
6004
|
-
*
|
|
6005
|
-
*
|
|
6006
|
-
*
|
|
6007
|
-
* Unless you specifically need a `Promise` or synchronous operation,
|
|
6008
|
-
* `runFork` is a good default choice.
|
|
6439
|
+
* Use when an effect should start in the background and return a fiber that can
|
|
6440
|
+
* be observed or interrupted. Prefer this when you do not need a `Promise` or
|
|
6441
|
+
* synchronous result.
|
|
6009
6442
|
*
|
|
6010
6443
|
* **Example** (Running an effect in the background)
|
|
6011
6444
|
*
|
|
@@ -6028,7 +6461,7 @@ export const fiberId = internal.fiberId;
|
|
|
6028
6461
|
* }, 500)
|
|
6029
6462
|
* ```
|
|
6030
6463
|
*
|
|
6031
|
-
* @category
|
|
6464
|
+
* @category running effects
|
|
6032
6465
|
* @since 2.0.0
|
|
6033
6466
|
*/
|
|
6034
6467
|
export const runFork = internal.runFork;
|
|
@@ -6059,7 +6492,7 @@ export const runFork = internal.runFork;
|
|
|
6059
6492
|
* const fiber = Effect.runForkWith(services)(program)
|
|
6060
6493
|
* ```
|
|
6061
6494
|
*
|
|
6062
|
-
* @category
|
|
6495
|
+
* @category running effects
|
|
6063
6496
|
* @since 4.0.0
|
|
6064
6497
|
*/
|
|
6065
6498
|
export const runForkWith = internal.runForkWith;
|
|
@@ -6103,7 +6536,7 @@ export const runForkWith = internal.runForkWith;
|
|
|
6103
6536
|
* interrupt()
|
|
6104
6537
|
* ```
|
|
6105
6538
|
*
|
|
6106
|
-
* @category
|
|
6539
|
+
* @category running effects
|
|
6107
6540
|
* @since 4.0.0
|
|
6108
6541
|
*/
|
|
6109
6542
|
export const runCallbackWith = internal.runCallbackWith;
|
|
@@ -6144,7 +6577,7 @@ export const runCallbackWith = internal.runCallbackWith;
|
|
|
6144
6577
|
* // interrupt() to cancel the fiber if needed
|
|
6145
6578
|
* ```
|
|
6146
6579
|
*
|
|
6147
|
-
* @category
|
|
6580
|
+
* @category running effects
|
|
6148
6581
|
* @since 2.0.0
|
|
6149
6582
|
*/
|
|
6150
6583
|
export const runCallback = internal.runCallback;
|
|
@@ -6153,7 +6586,7 @@ export const runCallback = internal.runCallback;
|
|
|
6153
6586
|
*
|
|
6154
6587
|
* **When to use**
|
|
6155
6588
|
*
|
|
6156
|
-
* Use
|
|
6589
|
+
* Use when you need to execute an effect and work with the
|
|
6157
6590
|
* result using `Promise` syntax, typically for compatibility with other
|
|
6158
6591
|
* promise-based code.
|
|
6159
6592
|
*
|
|
@@ -6181,7 +6614,7 @@ export const runCallback = internal.runCallback;
|
|
|
6181
6614
|
* ```
|
|
6182
6615
|
*
|
|
6183
6616
|
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
6184
|
-
* @category
|
|
6617
|
+
* @category running effects
|
|
6185
6618
|
* @since 2.0.0
|
|
6186
6619
|
*/
|
|
6187
6620
|
export const runPromise = internal.runPromise;
|
|
@@ -6211,7 +6644,7 @@ export const runPromise = internal.runPromise;
|
|
|
6211
6644
|
* Effect.runPromiseWith(context)(program).then(console.log)
|
|
6212
6645
|
* ```
|
|
6213
6646
|
*
|
|
6214
|
-
* @category
|
|
6647
|
+
* @category running effects
|
|
6215
6648
|
* @since 4.0.0
|
|
6216
6649
|
*/
|
|
6217
6650
|
export const runPromiseWith = internal.runPromiseWith;
|
|
@@ -6221,7 +6654,7 @@ export const runPromiseWith = internal.runPromiseWith;
|
|
|
6221
6654
|
*
|
|
6222
6655
|
* **When to use**
|
|
6223
6656
|
*
|
|
6224
|
-
* Use
|
|
6657
|
+
* Use when you need to determine if an effect succeeded
|
|
6225
6658
|
* or failed, including any defects, and you want to work with a `Promise`.
|
|
6226
6659
|
*
|
|
6227
6660
|
* **Details**
|
|
@@ -6259,7 +6692,9 @@ export const runPromiseWith = internal.runPromiseWith;
|
|
|
6259
6692
|
* // }
|
|
6260
6693
|
* ```
|
|
6261
6694
|
*
|
|
6262
|
-
* @
|
|
6695
|
+
* @see {@link runPromise} for a version that rejects on failure.
|
|
6696
|
+
*
|
|
6697
|
+
* @category running effects
|
|
6263
6698
|
* @since 2.0.0
|
|
6264
6699
|
*/
|
|
6265
6700
|
export const runPromiseExit = internal.runPromiseExit;
|
|
@@ -6293,7 +6728,7 @@ export const runPromiseExit = internal.runPromiseExit;
|
|
|
6293
6728
|
* })
|
|
6294
6729
|
* ```
|
|
6295
6730
|
*
|
|
6296
|
-
* @category
|
|
6731
|
+
* @category running effects
|
|
6297
6732
|
* @since 4.0.0
|
|
6298
6733
|
*/
|
|
6299
6734
|
export const runPromiseExitWith = internal.runPromiseExitWith;
|
|
@@ -6302,7 +6737,8 @@ export const runPromiseExitWith = internal.runPromiseExitWith;
|
|
|
6302
6737
|
*
|
|
6303
6738
|
* **When to use**
|
|
6304
6739
|
*
|
|
6305
|
-
* Use
|
|
6740
|
+
* Use when you need to execute an effect that is guaranteed to complete
|
|
6741
|
+
* synchronously.
|
|
6306
6742
|
*
|
|
6307
6743
|
* **Details**
|
|
6308
6744
|
*
|
|
@@ -6353,7 +6789,7 @@ export const runPromiseExitWith = internal.runPromiseExitWith;
|
|
|
6353
6789
|
*
|
|
6354
6790
|
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
6355
6791
|
* throwing an error.
|
|
6356
|
-
* @category
|
|
6792
|
+
* @category running effects
|
|
6357
6793
|
* @since 2.0.0
|
|
6358
6794
|
*/
|
|
6359
6795
|
export const runSync = internal.runSync;
|
|
@@ -6384,17 +6820,17 @@ export const runSync = internal.runSync;
|
|
|
6384
6820
|
* console.log(result) // 5
|
|
6385
6821
|
* ```
|
|
6386
6822
|
*
|
|
6387
|
-
* @category
|
|
6823
|
+
* @category running effects
|
|
6388
6824
|
* @since 4.0.0
|
|
6389
6825
|
*/
|
|
6390
6826
|
export const runSyncWith = internal.runSyncWith;
|
|
6391
6827
|
/**
|
|
6392
|
-
* Runs an effect synchronously and
|
|
6828
|
+
* Runs an effect synchronously and captures the outcome safely as an `Exit` type, which
|
|
6393
6829
|
* represents the outcome (success or failure) of the effect.
|
|
6394
6830
|
*
|
|
6395
6831
|
* **When to use**
|
|
6396
6832
|
*
|
|
6397
|
-
* Use
|
|
6833
|
+
* Use to find out whether an effect succeeded or failed,
|
|
6398
6834
|
* including any defects, without dealing with asynchronous operations.
|
|
6399
6835
|
*
|
|
6400
6836
|
* **Details**
|
|
@@ -6456,12 +6892,14 @@ export const runSyncWith = internal.runSyncWith;
|
|
|
6456
6892
|
* // }
|
|
6457
6893
|
* ```
|
|
6458
6894
|
*
|
|
6459
|
-
* @
|
|
6895
|
+
* @see {@link runSync} for a version that throws on failure.
|
|
6896
|
+
*
|
|
6897
|
+
* @category running effects
|
|
6460
6898
|
* @since 2.0.0
|
|
6461
6899
|
*/
|
|
6462
6900
|
export const runSyncExit = internal.runSyncExit;
|
|
6463
6901
|
/**
|
|
6464
|
-
* Runs an effect synchronously with provided services, returning an Exit result.
|
|
6902
|
+
* Runs an effect synchronously with provided services, returning an Exit result safely.
|
|
6465
6903
|
*
|
|
6466
6904
|
* **Example** (Running synchronously with services as Exit)
|
|
6467
6905
|
*
|
|
@@ -6496,7 +6934,7 @@ export const runSyncExit = internal.runSyncExit;
|
|
|
6496
6934
|
* // Success: 42
|
|
6497
6935
|
* ```
|
|
6498
6936
|
*
|
|
6499
|
-
* @category
|
|
6937
|
+
* @category running effects
|
|
6500
6938
|
* @since 4.0.0
|
|
6501
6939
|
*/
|
|
6502
6940
|
export const runSyncExitWith = internal.runSyncExitWith;
|
|
@@ -6520,7 +6958,7 @@ export const runSyncExitWith = internal.runSyncExitWith;
|
|
|
6520
6958
|
* Effect.runFork(greet("Ada"))
|
|
6521
6959
|
* ```
|
|
6522
6960
|
*
|
|
6523
|
-
* @category
|
|
6961
|
+
* @category functions
|
|
6524
6962
|
* @since 3.12.0
|
|
6525
6963
|
*/
|
|
6526
6964
|
export const fnUntraced = internal.fnUntraced;
|
|
@@ -6551,7 +6989,7 @@ export const fnUntraced = internal.fnUntraced;
|
|
|
6551
6989
|
* })
|
|
6552
6990
|
* ```
|
|
6553
6991
|
*
|
|
6554
|
-
* @category
|
|
6992
|
+
* @category functions
|
|
6555
6993
|
* @since 3.11.0
|
|
6556
6994
|
*/
|
|
6557
6995
|
export const fn = internal.fn;
|
|
@@ -6579,7 +7017,7 @@ export const fn = internal.fn;
|
|
|
6579
7017
|
* // Current time is: 1735484929744
|
|
6580
7018
|
* ```
|
|
6581
7019
|
*
|
|
6582
|
-
* @category
|
|
7020
|
+
* @category clock
|
|
6583
7021
|
* @since 2.0.0
|
|
6584
7022
|
*/
|
|
6585
7023
|
export const clockWith = internal.clockWith;
|
|
@@ -6892,6 +7330,10 @@ export const annotateLogs = /*#__PURE__*/dual(args => isEffect(args[0]), (effect
|
|
|
6892
7330
|
/**
|
|
6893
7331
|
* Adds log annotations to the current scope.
|
|
6894
7332
|
*
|
|
7333
|
+
* **When to use**
|
|
7334
|
+
*
|
|
7335
|
+
* Use to attach log annotations that last until the current scope closes.
|
|
7336
|
+
*
|
|
6895
7337
|
* **Details**
|
|
6896
7338
|
*
|
|
6897
7339
|
* This differs from `annotateLogs`, which only annotates a specific effect.
|
|
@@ -6914,6 +7356,8 @@ export const annotateLogs = /*#__PURE__*/dual(args => isEffect(args[0]), (effect
|
|
|
6914
7356
|
* Effect.runPromise(program)
|
|
6915
7357
|
* ```
|
|
6916
7358
|
*
|
|
7359
|
+
* @see {@link annotateLogs} for annotating one effect
|
|
7360
|
+
*
|
|
6917
7361
|
* @category logging
|
|
6918
7362
|
* @since 3.1.0
|
|
6919
7363
|
*/
|
|
@@ -7005,7 +7449,7 @@ export const withLogSpan = /*#__PURE__*/dual(2, (effect, label) => internal.flat
|
|
|
7005
7449
|
* )
|
|
7006
7450
|
* ```
|
|
7007
7451
|
*
|
|
7008
|
-
* @category
|
|
7452
|
+
* @category tracking
|
|
7009
7453
|
* @since 4.0.0
|
|
7010
7454
|
*/
|
|
7011
7455
|
export const track = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric, f) => onExit(self, exit => {
|
|
@@ -7058,7 +7502,7 @@ export const track = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric,
|
|
|
7058
7502
|
* )
|
|
7059
7503
|
* ```
|
|
7060
7504
|
*
|
|
7061
|
-
* @category
|
|
7505
|
+
* @category tracking
|
|
7062
7506
|
* @since 4.0.0
|
|
7063
7507
|
*/
|
|
7064
7508
|
export const trackSuccesses = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric, f) => tap(self, value => {
|
|
@@ -7113,7 +7557,7 @@ export const trackSuccesses = /*#__PURE__*/dual(args => isEffect(args[0]), (self
|
|
|
7113
7557
|
* )
|
|
7114
7558
|
* ```
|
|
7115
7559
|
*
|
|
7116
|
-
* @category
|
|
7560
|
+
* @category tracking
|
|
7117
7561
|
* @since 4.0.0
|
|
7118
7562
|
*/
|
|
7119
7563
|
export const trackErrors = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric, f) => tapError(self, error => {
|
|
@@ -7169,7 +7613,7 @@ export const trackErrors = /*#__PURE__*/dual(args => isEffect(args[0]), (self, m
|
|
|
7169
7613
|
* )
|
|
7170
7614
|
* ```
|
|
7171
7615
|
*
|
|
7172
|
-
* @category
|
|
7616
|
+
* @category tracking
|
|
7173
7617
|
* @since 4.0.0
|
|
7174
7618
|
*/
|
|
7175
7619
|
export const trackDefects = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric, f) => tapDefect(self, defect => {
|
|
@@ -7221,7 +7665,7 @@ export const trackDefects = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
|
|
|
7221
7665
|
* )
|
|
7222
7666
|
* ```
|
|
7223
7667
|
*
|
|
7224
|
-
* @category
|
|
7668
|
+
* @category tracking
|
|
7225
7669
|
* @since 4.0.0
|
|
7226
7670
|
*/
|
|
7227
7671
|
export const trackDuration = /*#__PURE__*/dual(args => isEffect(args[0]), (self, metric, f) => clockWith(clock => {
|
|
@@ -7237,12 +7681,12 @@ export const trackDuration = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
|
|
|
7237
7681
|
// Transactions
|
|
7238
7682
|
// -----------------------------------------------------------------------------
|
|
7239
7683
|
/**
|
|
7240
|
-
* Service that holds the current transaction state
|
|
7684
|
+
* Service that holds the current transaction state.
|
|
7241
7685
|
*
|
|
7242
7686
|
* **Details**
|
|
7243
7687
|
*
|
|
7244
|
-
*
|
|
7245
|
-
*
|
|
7688
|
+
* It includes a journal that stores non-committed changes to `TxRef` values and
|
|
7689
|
+
* a retry flag that records whether the transaction should be retried.
|
|
7246
7690
|
*
|
|
7247
7691
|
* **Example** (Building transactions)
|
|
7248
7692
|
*
|
|
@@ -7257,7 +7701,7 @@ export const trackDuration = /*#__PURE__*/dual(args => isEffect(args[0]), (self,
|
|
|
7257
7701
|
* })
|
|
7258
7702
|
* ```
|
|
7259
7703
|
*
|
|
7260
|
-
* @category
|
|
7704
|
+
* @category transactions
|
|
7261
7705
|
* @since 4.0.0
|
|
7262
7706
|
*/
|
|
7263
7707
|
export class Transaction extends /*#__PURE__*/Context.Service()("effect/Effect/Transaction") {}
|
|
@@ -7303,7 +7747,7 @@ export class Transaction extends /*#__PURE__*/Context.Service()("effect/Effect/T
|
|
|
7303
7747
|
* })
|
|
7304
7748
|
* ```
|
|
7305
7749
|
*
|
|
7306
|
-
* @category
|
|
7750
|
+
* @category transactions
|
|
7307
7751
|
* @since 4.0.0
|
|
7308
7752
|
*/
|
|
7309
7753
|
export const tx = effect => withFiber(fiber => {
|
|
@@ -7383,7 +7827,7 @@ function clearTransaction(state) {
|
|
|
7383
7827
|
state.journal.clear();
|
|
7384
7828
|
}
|
|
7385
7829
|
/**
|
|
7386
|
-
*
|
|
7830
|
+
* Retries the current transaction by signaling that it must be retried.
|
|
7387
7831
|
*
|
|
7388
7832
|
* **Details**
|
|
7389
7833
|
*
|
|
@@ -7418,7 +7862,7 @@ function clearTransaction(state) {
|
|
|
7418
7862
|
* Effect.runPromise(program).catch(console.error)
|
|
7419
7863
|
* ```
|
|
7420
7864
|
*
|
|
7421
|
-
* @category
|
|
7865
|
+
* @category transactions
|
|
7422
7866
|
* @since 4.0.0
|
|
7423
7867
|
*/
|
|
7424
7868
|
export const txRetry = /*#__PURE__*/flatMap(Transaction, state => {
|
|
@@ -7470,7 +7914,7 @@ export const txRetry = /*#__PURE__*/flatMap(Transaction, state => {
|
|
|
7470
7914
|
* // Output: Exit.failure with custom error message
|
|
7471
7915
|
* ```
|
|
7472
7916
|
*
|
|
7473
|
-
* @category
|
|
7917
|
+
* @category effectify
|
|
7474
7918
|
* @since 4.0.0
|
|
7475
7919
|
*/
|
|
7476
7920
|
export const effectify = (fn, onError, onSyncError) => (...args) => callback(resume => {
|
|
@@ -7494,8 +7938,8 @@ export const effectify = (fn, onError, onSyncError) => (...args) => callback(res
|
|
|
7494
7938
|
*
|
|
7495
7939
|
* **Details**
|
|
7496
7940
|
*
|
|
7497
|
-
* This
|
|
7498
|
-
*
|
|
7941
|
+
* This helper is checked at compile time and does not change the effect's
|
|
7942
|
+
* runtime behavior.
|
|
7499
7943
|
*
|
|
7500
7944
|
* **Example** (Constraining the success type)
|
|
7501
7945
|
*
|
|
@@ -7514,7 +7958,7 @@ export const effectify = (fn, onError, onSyncError) => (...args) => callback(res
|
|
|
7514
7958
|
* // Type 'string' is not assignable to type 'number'
|
|
7515
7959
|
* ```
|
|
7516
7960
|
*
|
|
7517
|
-
* @category
|
|
7961
|
+
* @category utility types
|
|
7518
7962
|
* @since 4.0.0
|
|
7519
7963
|
*/
|
|
7520
7964
|
export const satisfiesSuccessType = () => effect => effect;
|
|
@@ -7523,8 +7967,8 @@ export const satisfiesSuccessType = () => effect => effect;
|
|
|
7523
7967
|
*
|
|
7524
7968
|
* **Details**
|
|
7525
7969
|
*
|
|
7526
|
-
* This
|
|
7527
|
-
*
|
|
7970
|
+
* This helper is checked at compile time and does not change the effect's
|
|
7971
|
+
* runtime behavior.
|
|
7528
7972
|
*
|
|
7529
7973
|
* **Example** (Constraining the error type)
|
|
7530
7974
|
*
|
|
@@ -7545,7 +7989,7 @@ export const satisfiesSuccessType = () => effect => effect;
|
|
|
7545
7989
|
* // Type 'string' is not assignable to type 'ValidationError'
|
|
7546
7990
|
* ```
|
|
7547
7991
|
*
|
|
7548
|
-
* @category
|
|
7992
|
+
* @category utility types
|
|
7549
7993
|
* @since 4.0.0
|
|
7550
7994
|
*/
|
|
7551
7995
|
export const satisfiesErrorType = () => effect => effect;
|
|
@@ -7554,8 +7998,8 @@ export const satisfiesErrorType = () => effect => effect;
|
|
|
7554
7998
|
*
|
|
7555
7999
|
* **Details**
|
|
7556
8000
|
*
|
|
7557
|
-
* This
|
|
7558
|
-
*
|
|
8001
|
+
* This helper is checked at compile time and does not change the effect's
|
|
8002
|
+
* runtime behavior.
|
|
7559
8003
|
*
|
|
7560
8004
|
* **Example** (Constraining the services type)
|
|
7561
8005
|
*
|
|
@@ -7574,19 +8018,17 @@ export const satisfiesErrorType = () => effect => effect;
|
|
|
7574
8018
|
* // const constrainedInvalid = satisfiesStringServices(invalidEffect)
|
|
7575
8019
|
* ```
|
|
7576
8020
|
*
|
|
7577
|
-
* @category
|
|
8021
|
+
* @category utility types
|
|
7578
8022
|
* @since 4.0.0
|
|
7579
8023
|
*/
|
|
7580
8024
|
export const satisfiesServicesType = () => effect => effect;
|
|
7581
8025
|
/**
|
|
7582
|
-
*
|
|
7583
|
-
* and applies the mapping function eagerly when possible.
|
|
8026
|
+
* Applies `map` eagerly when an effect is already resolved.
|
|
7584
8027
|
*
|
|
7585
8028
|
* **When to use**
|
|
7586
8029
|
*
|
|
7587
|
-
*
|
|
7588
|
-
*
|
|
7589
|
-
* the effect pipeline.
|
|
8030
|
+
* Use when an already-resolved effect should apply a success transformation
|
|
8031
|
+
* immediately while pending effects still use regular mapping.
|
|
7590
8032
|
*
|
|
7591
8033
|
* **Details**
|
|
7592
8034
|
*
|
|
@@ -7610,19 +8052,18 @@ export const satisfiesServicesType = () => effect => effect;
|
|
|
7610
8052
|
* const mappedPending = Effect.mapEager(pending, (n) => n * 2) // Uses regular map
|
|
7611
8053
|
* ```
|
|
7612
8054
|
*
|
|
7613
|
-
* @category
|
|
8055
|
+
* @category eager
|
|
7614
8056
|
* @since 4.0.0
|
|
7615
8057
|
*/
|
|
7616
8058
|
export const mapEager = internal.mapEager;
|
|
7617
8059
|
/**
|
|
7618
|
-
*
|
|
7619
|
-
* and applies the error mapping function eagerly when possible.
|
|
8060
|
+
* Applies `mapError` eagerly when an effect is already resolved.
|
|
7620
8061
|
*
|
|
7621
8062
|
* **When to use**
|
|
7622
8063
|
*
|
|
7623
|
-
*
|
|
7624
|
-
*
|
|
7625
|
-
*
|
|
8064
|
+
* Use when an already-resolved failed effect should apply an error
|
|
8065
|
+
* transformation immediately while pending effects still use regular error
|
|
8066
|
+
* mapping.
|
|
7626
8067
|
*
|
|
7627
8068
|
* **Details**
|
|
7628
8069
|
*
|
|
@@ -7649,19 +8090,17 @@ export const mapEager = internal.mapEager;
|
|
|
7649
8090
|
* ) // Uses regular mapError
|
|
7650
8091
|
* ```
|
|
7651
8092
|
*
|
|
7652
|
-
* @category
|
|
8093
|
+
* @category eager
|
|
7653
8094
|
* @since 4.0.0
|
|
7654
8095
|
*/
|
|
7655
8096
|
export const mapErrorEager = internal.mapErrorEager;
|
|
7656
8097
|
/**
|
|
7657
|
-
*
|
|
7658
|
-
* and applies the appropriate mapping function eagerly when possible.
|
|
8098
|
+
* Applies `mapBoth` eagerly when an effect is already resolved.
|
|
7659
8099
|
*
|
|
7660
8100
|
* **When to use**
|
|
7661
8101
|
*
|
|
7662
|
-
*
|
|
7663
|
-
*
|
|
7664
|
-
* the effect pipeline.
|
|
8102
|
+
* Use when an already-resolved effect should transform either success or
|
|
8103
|
+
* failure immediately while pending effects still use regular channel mapping.
|
|
7665
8104
|
*
|
|
7666
8105
|
* **Details**
|
|
7667
8106
|
*
|
|
@@ -7690,19 +8129,17 @@ export const mapErrorEager = internal.mapErrorEager;
|
|
|
7690
8129
|
* }) // onFailure applied eagerly
|
|
7691
8130
|
* ```
|
|
7692
8131
|
*
|
|
7693
|
-
* @category
|
|
8132
|
+
* @category eager
|
|
7694
8133
|
* @since 4.0.0
|
|
7695
8134
|
*/
|
|
7696
8135
|
export const mapBothEager = internal.mapBothEager;
|
|
7697
8136
|
/**
|
|
7698
|
-
*
|
|
7699
|
-
* and applies the flatMap function eagerly when possible.
|
|
8137
|
+
* Applies `flatMap` eagerly when an effect is already resolved.
|
|
7700
8138
|
*
|
|
7701
8139
|
* **When to use**
|
|
7702
8140
|
*
|
|
7703
|
-
*
|
|
7704
|
-
*
|
|
7705
|
-
* the effect pipeline.
|
|
8141
|
+
* Use when an already-resolved successful effect should bind immediately to the
|
|
8142
|
+
* next effect while pending effects still use regular flat mapping.
|
|
7706
8143
|
*
|
|
7707
8144
|
* **Details**
|
|
7708
8145
|
*
|
|
@@ -7729,19 +8166,17 @@ export const mapBothEager = internal.mapBothEager;
|
|
|
7729
8166
|
* ) // Uses regular flatMap
|
|
7730
8167
|
* ```
|
|
7731
8168
|
*
|
|
7732
|
-
* @category
|
|
8169
|
+
* @category eager
|
|
7733
8170
|
* @since 4.0.0
|
|
7734
8171
|
*/
|
|
7735
8172
|
export const flatMapEager = internal.flatMapEager;
|
|
7736
8173
|
/**
|
|
7737
|
-
*
|
|
7738
|
-
* and applies the catch function eagerly when possible.
|
|
8174
|
+
* Applies `catch` eagerly when an effect is already resolved.
|
|
7739
8175
|
*
|
|
7740
8176
|
* **When to use**
|
|
7741
8177
|
*
|
|
7742
|
-
*
|
|
7743
|
-
*
|
|
7744
|
-
* the effect pipeline.
|
|
8178
|
+
* Use when an already-resolved failed effect should recover immediately while
|
|
8179
|
+
* pending effects still use regular error recovery.
|
|
7745
8180
|
*
|
|
7746
8181
|
* **Details**
|
|
7747
8182
|
*
|
|
@@ -7778,7 +8213,7 @@ export const flatMapEager = internal.flatMapEager;
|
|
|
7778
8213
|
* ) // Uses regular catch
|
|
7779
8214
|
* ```
|
|
7780
8215
|
*
|
|
7781
|
-
* @category
|
|
8216
|
+
* @category eager
|
|
7782
8217
|
* @since 4.0.0
|
|
7783
8218
|
*/
|
|
7784
8219
|
export const catchEager = internal.catchEager;
|
|
@@ -7804,7 +8239,7 @@ export const catchEager = internal.catchEager;
|
|
|
7804
8239
|
* const effect = computation() // Executed immediately if all effects are sync
|
|
7805
8240
|
* ```
|
|
7806
8241
|
*
|
|
7807
|
-
* @category
|
|
8242
|
+
* @category eager
|
|
7808
8243
|
* @since 4.0.0
|
|
7809
8244
|
*/
|
|
7810
8245
|
export const fnUntracedEager = internal.fnUntracedEager;
|