effect 4.0.0-beta.73 → 4.0.0-beta.75
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 +745 -627
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +277 -217
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +37 -30
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +19 -16
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +34 -40
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +16 -16
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +10 -10
- package/dist/Boolean.js +6 -6
- package/dist/Brand.d.ts +13 -11
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +10 -8
- package/dist/Brand.js.map +1 -1
- package/dist/Cause.d.ts +21 -23
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +21 -23
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +282 -72
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +108 -28
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +11 -11
- package/dist/ChannelSchema.js +5 -5
- package/dist/Chunk.d.ts +86 -33
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +48 -13
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +3 -3
- package/dist/Clock.js +3 -3
- package/dist/Combiner.d.ts +9 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +9 -13
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +49 -56
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +40 -43
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +34 -44
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +24 -32
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +2 -2
- package/dist/Console.js +2 -2
- package/dist/Context.d.ts +63 -75
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +29 -33
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +6 -6
- package/dist/Cron.js +6 -6
- package/dist/Crypto.d.ts +4 -4
- package/dist/Crypto.js +4 -4
- package/dist/Data.d.ts +21 -15
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +7 -7
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +35 -16
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +35 -8
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +61 -52
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +21 -18
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +50 -37
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +24 -13
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +574 -474
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +273 -213
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +5 -0
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +5 -0
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +28 -41
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +12 -19
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +72 -100
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +54 -74
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +1 -1
- package/dist/ErrorReporter.js +1 -1
- package/dist/ExecutionPlan.d.ts +2 -2
- package/dist/ExecutionPlan.js +1 -1
- package/dist/Exit.d.ts +79 -96
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +57 -64
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +8 -6
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +8 -6
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +25 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +15 -0
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +35 -0
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +15 -0
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +20 -0
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +10 -0
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +6 -6
- package/dist/FileSystem.js +2 -2
- package/dist/Filter.d.ts +4 -4
- package/dist/Filter.js +4 -4
- package/dist/Formatter.d.ts +14 -19
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +14 -19
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +20 -21
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +14 -15
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +13 -13
- package/dist/Graph.js +7 -7
- package/dist/HKT.d.ts +3 -3
- package/dist/Hash.d.ts +2 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +2 -1
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +18 -3
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +5 -0
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +9 -9
- package/dist/HashRing.js +3 -3
- package/dist/HashSet.d.ts +1 -1
- package/dist/Iterable.d.ts +39 -27
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +21 -11
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +2 -3
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +2 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +2 -6
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +2 -6
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +17 -13
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +17 -13
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +4 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +4 -3
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +108 -130
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +43 -51
- package/dist/Layer.js.map +1 -1
- package/dist/Logger.d.ts +16 -19
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +15 -18
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +2 -2
- package/dist/Match.d.ts +22 -22
- package/dist/Match.js +18 -18
- package/dist/Metric.d.ts +105 -125
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +54 -64
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +21 -12
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +7 -4
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableList.d.ts +15 -0
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +15 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +56 -42
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +28 -22
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +10 -7
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +10 -7
- package/dist/Newtype.js.map +1 -1
- package/dist/Number.d.ts +23 -11
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +9 -5
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +16 -16
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +10 -9
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +232 -204
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +113 -96
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +119 -180
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +93 -145
- package/dist/Order.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +14 -14
- package/dist/PartitionedSemaphore.js +6 -6
- package/dist/Path.d.ts +3 -3
- package/dist/Path.js +3 -3
- package/dist/Pipeable.d.ts +3 -3
- package/dist/Pipeable.js +3 -3
- package/dist/PlatformError.d.ts +4 -4
- package/dist/PlatformError.js +4 -4
- package/dist/Pool.d.ts +7 -11
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +3 -5
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +279 -268
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +128 -123
- package/dist/Predicate.js.map +1 -1
- package/dist/PubSub.d.ts +33 -23
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +21 -11
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +4 -4
- package/dist/Pull.js +4 -4
- package/dist/Queue.d.ts +70 -31
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +66 -27
- package/dist/Queue.js.map +1 -1
- package/dist/RcRef.d.ts +0 -4
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +15 -15
- package/dist/Record.js +5 -5
- package/dist/Redactable.d.ts +2 -2
- package/dist/Redactable.js +2 -2
- package/dist/Redacted.d.ts +5 -5
- package/dist/Redacted.js +4 -4
- package/dist/Reducer.d.ts +2 -3
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -3
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +23 -22
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +21 -20
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +4 -4
- package/dist/References.js +4 -4
- package/dist/RegExp.d.ts +1 -1
- package/dist/RegExp.js +1 -1
- package/dist/Request.d.ts +22 -22
- package/dist/Request.js +6 -6
- package/dist/RequestResolver.d.ts +6 -6
- package/dist/RequestResolver.js +2 -2
- package/dist/Resource.d.ts +3 -3
- package/dist/Resource.js +3 -3
- package/dist/Result.d.ts +95 -51
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +53 -30
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +11 -8
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +11 -8
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +151 -89
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +59 -47
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +6 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +6 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +620 -830
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +543 -452
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +43 -22
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +80 -59
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +139 -119
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +133 -113
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +37 -39
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -17
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +75 -156
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +75 -148
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +30 -21
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +26 -22
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +169 -145
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +183 -159
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.js +2 -2
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +16 -1
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +16 -1
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedRef.d.ts +14 -18
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +6 -8
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +9 -9
- package/dist/Semaphore.js +3 -3
- package/dist/Sink.d.ts +18 -18
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +12 -12
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +4 -5
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +4 -5
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +376 -99
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +158 -43
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +11 -14
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +5 -6
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +23 -21
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +14 -12
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +24 -19
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +12 -7
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +145 -120
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +51 -42
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.d.ts +1 -1
- package/dist/Terminal.js +1 -1
- package/dist/Tracer.d.ts +9 -9
- package/dist/Tracer.js +6 -6
- package/dist/Trie.d.ts +15 -0
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +5 -0
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +39 -33
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +23 -19
- package/dist/Tuple.js.map +1 -1
- package/dist/TxHashMap.d.ts +3 -3
- package/dist/TxHashSet.d.ts +1 -1
- package/dist/TxReentrantLock.d.ts +6 -3
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +2 -1
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +16 -16
- package/dist/TxRef.js +8 -8
- package/dist/TxSubscriptionRef.d.ts +43 -27
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +19 -13
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +12 -38
- package/dist/Types.d.ts.map +1 -1
- package/dist/Types.js +0 -2
- package/dist/UndefinedOr.d.ts +15 -14
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +11 -10
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +9 -9
- package/dist/Unify.js +1 -1
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +9 -9
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/equivalence.js +9 -9
- package/dist/internal/schema/equivalence.js.map +1 -1
- package/dist/internal/schema/representation.js +14 -14
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.js +11 -11
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/TestClock.d.ts +5 -5
- package/dist/testing/TestClock.js +4 -4
- package/dist/testing/TestConsole.d.ts +3 -3
- package/dist/testing/TestConsole.js +3 -3
- package/dist/testing/TestSchema.d.ts +10 -10
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +9 -9
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +4 -2
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +4 -2
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +17 -20
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +36 -39
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +6 -7
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +6 -7
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +5 -5
- package/dist/unstable/ai/EmbeddingModel.js +4 -4
- package/dist/unstable/ai/IdGenerator.d.ts +4 -5
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +3 -4
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +7 -6
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +6 -5
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +14 -12
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +19 -17
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +11 -4
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +8 -5
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +20 -18
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +45 -43
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +17 -17
- package/dist/unstable/ai/Prompt.js +4 -4
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +3 -2
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +3 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +26 -11
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +9 -4
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +1 -1
- package/dist/unstable/ai/Tokenizer.js +1 -1
- package/dist/unstable/ai/Tool.d.ts +13 -12
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +14 -13
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +2 -2
- package/dist/unstable/ai/Toolkit.js +2 -2
- package/dist/unstable/cli/Command.d.ts +37 -16
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +16 -9
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +1 -1
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +7 -6
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +7 -6
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +6 -1
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +7 -2
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +13 -10
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +6 -5
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +4 -3
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +11 -11
- package/dist/unstable/cli/internal/parser.js +145 -10
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -2
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +5 -0
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +5 -0
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +3 -3
- package/dist/unstable/cluster/ClusterSchema.js +3 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +15 -15
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +1 -1
- package/dist/unstable/cluster/Entity.js +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +10 -0
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +10 -0
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +2 -2
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +2 -2
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -2
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +12 -12
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +2 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +2 -1
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +2 -2
- package/dist/unstable/cluster/RunnerServer.js +2 -2
- package/dist/unstable/cluster/Runners.d.ts +4 -4
- package/dist/unstable/cluster/Runners.js +4 -4
- package/dist/unstable/cluster/ShardId.js +3 -3
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +4 -4
- package/dist/unstable/cluster/Sharding.js +4 -4
- package/dist/unstable/cluster/ShardingConfig.d.ts +4 -4
- package/dist/unstable/cluster/ShardingConfig.js +4 -4
- package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +6 -6
- package/dist/unstable/cluster/Snowflake.js +8 -8
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +2 -2
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +2 -2
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +5 -5
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +5 -0
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +5 -0
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +2 -2
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +2 -2
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +2 -1
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +2 -1
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +10 -0
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +10 -0
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +4 -4
- package/dist/unstable/eventlog/EventLog.js +4 -4
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +2 -3
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +2 -3
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +8 -10
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +8 -10
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +4 -4
- package/dist/unstable/eventlog/EventLogSessionAuth.js +4 -4
- package/dist/unstable/http/Cookies.d.ts +1 -1
- package/dist/unstable/http/Cookies.js +4 -4
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +3 -4
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +3 -4
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +2 -2
- package/dist/unstable/http/FetchHttpClient.js +2 -2
- package/dist/unstable/http/Headers.js +2 -2
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.js +2 -2
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +3 -3
- package/dist/unstable/http/HttpClient.js +3 -3
- package/dist/unstable/http/HttpClientRequest.d.ts +32 -5
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +10 -1
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.js +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +1 -1
- package/dist/unstable/http/HttpPlatform.js +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +5 -5
- package/dist/unstable/http/HttpRouter.js +5 -5
- package/dist/unstable/http/HttpServerResponse.d.ts +28 -23
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +13 -8
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.js +3 -3
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +33 -33
- package/dist/unstable/http/Url.js +11 -11
- package/dist/unstable/http/UrlParams.d.ts +30 -0
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +16 -6
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +4 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +10 -8
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +15 -15
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.js +13 -13
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js +3 -3
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +9 -9
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +11 -11
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +5 -0
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +5 -0
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +8 -6
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +6 -4
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +3 -3
- package/dist/unstable/persistence/KeyValueStore.js +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.js +2 -2
- package/dist/unstable/persistence/PersistedQueue.d.ts +8 -8
- package/dist/unstable/persistence/PersistedQueue.js +8 -8
- package/dist/unstable/persistence/RateLimiter.d.ts +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -5
- package/dist/unstable/process/ChildProcess.js +2 -2
- package/dist/unstable/reactivity/AsyncResult.d.ts +4 -4
- package/dist/unstable/reactivity/AsyncResult.js +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +4 -4
- package/dist/unstable/reactivity/Atom.js +4 -4
- package/dist/unstable/reactivity/AtomRegistry.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +1 -1
- package/dist/unstable/reactivity/Reactivity.js +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +5 -5
- package/dist/unstable/rpc/Rpc.js +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +5 -5
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +2 -2
- package/dist/unstable/rpc/RpcSerialization.d.ts +2 -2
- package/dist/unstable/rpc/RpcSerialization.js +2 -2
- package/dist/unstable/schema/Model.d.ts +2 -2
- package/dist/unstable/schema/Model.js +6 -6
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +2 -2
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +3 -3
- package/dist/unstable/socket/Socket.js +3 -3
- package/dist/unstable/socket/SocketServer.d.ts +1 -1
- package/dist/unstable/socket/SocketServer.js +1 -1
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +3 -3
- package/dist/unstable/sql/SqlClient.js +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts +1 -1
- package/dist/unstable/sql/SqlConnection.js +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +4 -4
- package/dist/unstable/sql/SqlSchema.js +4 -4
- package/dist/unstable/sql/Statement.d.ts +2 -2
- package/dist/unstable/sql/Statement.js +2 -2
- package/dist/unstable/workers/Transferable.d.ts +3 -3
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +6 -6
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +1 -1
- package/dist/unstable/workers/Worker.js +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -1
- package/dist/unstable/workflow/Activity.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +8 -8
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +1 -2
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +1 -2
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +35 -15
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +94 -72
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +10 -2
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -8
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +2 -4
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +9 -11
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +7 -7
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +745 -627
- package/src/BigDecimal.ts +37 -30
- package/src/BigInt.ts +34 -40
- package/src/Boolean.ts +10 -10
- package/src/Brand.ts +16 -14
- package/src/Cause.ts +21 -23
- package/src/Channel.ts +316 -76
- package/src/ChannelSchema.ts +11 -11
- package/src/Chunk.ts +87 -34
- package/src/Clock.ts +3 -3
- package/src/Combiner.ts +9 -13
- package/src/Config.ts +60 -67
- package/src/ConfigProvider.ts +34 -44
- package/src/Console.ts +2 -2
- package/src/Context.ts +64 -76
- package/src/Cron.ts +6 -6
- package/src/Crypto.ts +4 -4
- package/src/Data.ts +21 -15
- package/src/DateTime.ts +35 -16
- package/src/Deferred.ts +61 -52
- package/src/Duration.ts +50 -37
- package/src/Effect.ts +574 -474
- package/src/Encoding.ts +5 -0
- package/src/Equal.ts +28 -41
- package/src/Equivalence.ts +72 -100
- package/src/ErrorReporter.ts +1 -1
- package/src/ExecutionPlan.ts +2 -2
- package/src/Exit.ts +79 -96
- package/src/Fiber.ts +8 -6
- package/src/FiberHandle.ts +25 -0
- package/src/FiberMap.ts +35 -0
- package/src/FiberSet.ts +20 -0
- package/src/FileSystem.ts +6 -6
- package/src/Filter.ts +4 -4
- package/src/Formatter.ts +14 -19
- package/src/Function.ts +20 -21
- package/src/Graph.ts +13 -13
- package/src/HKT.ts +3 -3
- package/src/Hash.ts +2 -1
- package/src/HashMap.ts +18 -3
- package/src/HashRing.ts +9 -9
- package/src/HashSet.ts +1 -1
- package/src/Iterable.ts +39 -27
- package/src/JsonPatch.ts +2 -3
- package/src/JsonPointer.ts +2 -6
- package/src/JsonSchema.ts +17 -13
- package/src/Latch.ts +4 -3
- package/src/Layer.ts +108 -130
- package/src/Logger.ts +22 -25
- package/src/ManagedRuntime.ts +2 -2
- package/src/Match.ts +22 -22
- package/src/Metric.ts +129 -157
- package/src/MutableHashMap.ts +35 -20
- package/src/MutableList.ts +15 -0
- package/src/MutableRef.ts +56 -42
- package/src/Newtype.ts +10 -7
- package/src/Number.ts +23 -11
- package/src/Optic.ts +25 -22
- package/src/Option.ts +232 -204
- package/src/Order.ts +119 -180
- package/src/PartitionedSemaphore.ts +14 -14
- package/src/Path.ts +3 -3
- package/src/Pipeable.ts +3 -3
- package/src/PlatformError.ts +4 -4
- package/src/Pool.ts +7 -11
- package/src/Predicate.ts +279 -268
- package/src/PubSub.ts +33 -23
- package/src/Pull.ts +4 -4
- package/src/Queue.ts +70 -31
- package/src/RcRef.ts +0 -4
- package/src/Record.ts +15 -15
- package/src/Redactable.ts +2 -2
- package/src/Redacted.ts +5 -5
- package/src/Reducer.ts +2 -3
- package/src/Ref.ts +61 -58
- package/src/References.ts +4 -4
- package/src/RegExp.ts +1 -1
- package/src/Request.ts +22 -22
- package/src/RequestResolver.ts +8 -8
- package/src/Resource.ts +3 -3
- package/src/Result.ts +105 -51
- package/src/Runtime.ts +11 -8
- package/src/Schedule.ts +157 -90
- package/src/Scheduler.ts +6 -4
- package/src/Schema.ts +1020 -1108
- package/src/SchemaAST.ts +149 -118
- package/src/SchemaGetter.ts +155 -134
- package/src/SchemaIssue.ts +39 -41
- package/src/SchemaParser.ts +176 -232
- package/src/SchemaRepresentation.ts +38 -28
- package/src/SchemaTransformation.ts +233 -207
- package/src/SchemaUtils.ts +2 -2
- package/src/Scope.ts +16 -1
- package/src/ScopedCache.ts +1 -1
- package/src/ScopedRef.ts +14 -18
- package/src/Semaphore.ts +9 -9
- package/src/Sink.ts +18 -18
- package/src/Stdio.ts +4 -5
- package/src/Stream.ts +411 -114
- package/src/String.ts +11 -14
- package/src/Struct.ts +23 -21
- package/src/SubscriptionRef.ts +24 -19
- package/src/SynchronizedRef.ts +145 -120
- package/src/Terminal.ts +1 -1
- package/src/Tracer.ts +9 -9
- package/src/Trie.ts +15 -0
- package/src/Tuple.ts +39 -33
- package/src/TxHashMap.ts +3 -3
- package/src/TxHashSet.ts +1 -1
- package/src/TxReentrantLock.ts +6 -3
- package/src/TxRef.ts +16 -16
- package/src/TxSubscriptionRef.ts +43 -27
- package/src/Types.ts +12 -39
- package/src/UndefinedOr.ts +15 -14
- package/src/Unify.ts +9 -9
- package/src/internal/schema/annotations.ts +4 -4
- package/src/internal/schema/arbitrary.ts +16 -16
- package/src/internal/schema/equivalence.ts +11 -11
- package/src/internal/schema/representation.ts +23 -23
- package/src/internal/schema/schema.ts +17 -17
- package/src/testing/TestClock.ts +5 -5
- package/src/testing/TestConsole.ts +3 -3
- package/src/testing/TestSchema.ts +20 -20
- package/src/unstable/ai/AiError.ts +4 -2
- package/src/unstable/ai/AnthropicStructuredOutput.ts +59 -56
- package/src/unstable/ai/Chat.ts +6 -7
- package/src/unstable/ai/EmbeddingModel.ts +5 -5
- package/src/unstable/ai/IdGenerator.ts +4 -5
- package/src/unstable/ai/LanguageModel.ts +9 -8
- package/src/unstable/ai/McpSchema.ts +19 -17
- package/src/unstable/ai/McpServer.ts +14 -7
- package/src/unstable/ai/OpenAiStructuredOutput.ts +72 -61
- package/src/unstable/ai/Prompt.ts +20 -20
- package/src/unstable/ai/ResponseIdTracker.ts +3 -2
- package/src/unstable/ai/Telemetry.ts +26 -11
- package/src/unstable/ai/Tokenizer.ts +1 -1
- package/src/unstable/ai/Tool.ts +17 -16
- package/src/unstable/ai/Toolkit.ts +2 -2
- package/src/unstable/cli/Command.ts +42 -17
- package/src/unstable/cli/Completions.ts +1 -1
- package/src/unstable/cli/Flag.ts +7 -6
- package/src/unstable/cli/GlobalFlag.ts +7 -1
- package/src/unstable/cli/Param.ts +24 -19
- package/src/unstable/cli/Primitive.ts +6 -5
- package/src/unstable/cli/Prompt.ts +11 -11
- package/src/unstable/cli/internal/parser.ts +204 -10
- package/src/unstable/cluster/ClusterCron.ts +1 -2
- package/src/unstable/cluster/ClusterMetrics.ts +5 -0
- package/src/unstable/cluster/ClusterSchema.ts +3 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +15 -15
- package/src/unstable/cluster/Entity.ts +1 -1
- package/src/unstable/cluster/EntityResource.ts +10 -0
- package/src/unstable/cluster/Envelope.ts +3 -3
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +1 -1
- package/src/unstable/cluster/Reply.ts +14 -12
- package/src/unstable/cluster/RunnerHealth.ts +2 -1
- package/src/unstable/cluster/RunnerServer.ts +2 -2
- package/src/unstable/cluster/Runners.ts +4 -4
- package/src/unstable/cluster/ShardId.ts +3 -3
- package/src/unstable/cluster/Sharding.ts +4 -4
- package/src/unstable/cluster/ShardingConfig.ts +4 -4
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +8 -8
- package/src/unstable/cluster/internal/entityManager.ts +2 -2
- package/src/unstable/devtools/DevToolsClient.ts +1 -1
- package/src/unstable/encoding/Msgpack.ts +6 -6
- package/src/unstable/encoding/Ndjson.ts +5 -0
- package/src/unstable/encoding/Sse.ts +2 -2
- package/src/unstable/eventlog/EventGroup.ts +2 -1
- package/src/unstable/eventlog/EventJournal.ts +10 -0
- package/src/unstable/eventlog/EventLog.ts +4 -4
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogRemote.ts +1 -1
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +2 -3
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +8 -10
- package/src/unstable/eventlog/EventLogSessionAuth.ts +4 -4
- package/src/unstable/http/Cookies.ts +5 -5
- package/src/unstable/http/Etag.ts +3 -4
- package/src/unstable/http/FetchHttpClient.ts +2 -2
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpBody.ts +2 -2
- package/src/unstable/http/HttpClient.ts +3 -3
- package/src/unstable/http/HttpClientRequest.ts +32 -5
- package/src/unstable/http/HttpMiddleware.ts +1 -1
- package/src/unstable/http/HttpPlatform.ts +1 -1
- package/src/unstable/http/HttpRouter.ts +5 -5
- package/src/unstable/http/HttpServerResponse.ts +28 -23
- package/src/unstable/http/Multipart.ts +3 -3
- package/src/unstable/http/Url.ts +33 -33
- package/src/unstable/http/UrlParams.ts +36 -6
- package/src/unstable/httpapi/HttpApi.ts +6 -5
- package/src/unstable/httpapi/HttpApiBuilder.ts +14 -13
- package/src/unstable/httpapi/HttpApiClient.ts +16 -16
- package/src/unstable/httpapi/HttpApiError.ts +13 -13
- package/src/unstable/httpapi/HttpApiMiddleware.ts +3 -3
- package/src/unstable/httpapi/HttpApiSchema.ts +15 -15
- package/src/unstable/httpapi/OpenApi.ts +18 -18
- package/src/unstable/observability/OtlpResource.ts +5 -0
- package/src/unstable/observability/PrometheusMetrics.ts +8 -6
- package/src/unstable/persistence/KeyValueStore.ts +3 -3
- package/src/unstable/persistence/Persistable.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +8 -8
- package/src/unstable/persistence/RateLimiter.ts +1 -1
- package/src/unstable/process/ChildProcess.ts +5 -5
- package/src/unstable/reactivity/AsyncResult.ts +4 -4
- package/src/unstable/reactivity/Atom.ts +4 -4
- package/src/unstable/reactivity/AtomRegistry.ts +1 -1
- package/src/unstable/reactivity/Reactivity.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +5 -5
- package/src/unstable/rpc/RpcMiddleware.ts +1 -1
- package/src/unstable/rpc/RpcSchema.ts +5 -5
- package/src/unstable/rpc/RpcSerialization.ts +2 -2
- package/src/unstable/schema/Model.ts +7 -7
- package/src/unstable/schema/VariantSchema.ts +2 -2
- package/src/unstable/socket/Socket.ts +3 -3
- package/src/unstable/socket/SocketServer.ts +1 -1
- package/src/unstable/sql/Migrator.ts +1 -1
- package/src/unstable/sql/SqlClient.ts +3 -3
- package/src/unstable/sql/SqlConnection.ts +1 -1
- package/src/unstable/sql/SqlSchema.ts +4 -4
- package/src/unstable/sql/Statement.ts +2 -2
- package/src/unstable/workers/Transferable.ts +7 -7
- package/src/unstable/workers/Worker.ts +1 -1
- package/src/unstable/workflow/Activity.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +8 -8
- package/src/unstable/workflow/DurableQueue.ts +1 -2
- package/src/unstable/workflow/Workflow.ts +159 -114
- package/src/unstable/workflow/WorkflowEngine.ts +16 -8
- package/src/unstable/workflow/WorkflowProxy.ts +9 -11
- package/src/unstable/workflow/WorkflowProxyServer.ts +7 -7
package/src/Effect.ts
CHANGED
|
@@ -598,10 +598,8 @@ export const all: <
|
|
|
598
598
|
*
|
|
599
599
|
* **Details**
|
|
600
600
|
*
|
|
601
|
-
* The returned tuple is `[excluded, satisfying]`, where
|
|
602
|
-
*
|
|
603
|
-
* - `excluded` contains all failures.
|
|
604
|
-
* - `satisfying` contains all successes.
|
|
601
|
+
* The returned tuple is `[excluded, satisfying]`, where `excluded` contains
|
|
602
|
+
* all failures and `satisfying` contains all successes.
|
|
605
603
|
*
|
|
606
604
|
* This function runs every effect and never fails. Use `concurrency` to control
|
|
607
605
|
* parallelism.
|
|
@@ -629,10 +627,8 @@ export const partition: {
|
|
|
629
627
|
*
|
|
630
628
|
* **Details**
|
|
631
629
|
*
|
|
632
|
-
* The returned tuple is `[excluded, satisfying]`, where
|
|
633
|
-
*
|
|
634
|
-
* - `excluded` contains all failures.
|
|
635
|
-
* - `satisfying` contains all successes.
|
|
630
|
+
* The returned tuple is `[excluded, satisfying]`, where `excluded` contains
|
|
631
|
+
* all failures and `satisfying` contains all successes.
|
|
636
632
|
*
|
|
637
633
|
* This function runs every effect and never fails. Use `concurrency` to control
|
|
638
634
|
* parallelism.
|
|
@@ -663,10 +659,8 @@ export const partition: {
|
|
|
663
659
|
*
|
|
664
660
|
* **Details**
|
|
665
661
|
*
|
|
666
|
-
* The returned tuple is `[excluded, satisfying]`, where
|
|
667
|
-
*
|
|
668
|
-
* - `excluded` contains all failures.
|
|
669
|
-
* - `satisfying` contains all successes.
|
|
662
|
+
* The returned tuple is `[excluded, satisfying]`, where `excluded` contains
|
|
663
|
+
* all failures and `satisfying` contains all successes.
|
|
670
664
|
*
|
|
671
665
|
* This function runs every effect and never fails. Use `concurrency` to control
|
|
672
666
|
* parallelism.
|
|
@@ -1370,7 +1364,7 @@ export const whileLoop: <A, E, R>(options: {
|
|
|
1370
1364
|
* ```
|
|
1371
1365
|
*
|
|
1372
1366
|
* @see {@link tryPromise} for a version that can handle failures.
|
|
1373
|
-
* @category
|
|
1367
|
+
* @category constructors
|
|
1374
1368
|
* @since 2.0.0
|
|
1375
1369
|
*/
|
|
1376
1370
|
export const promise: <A>(
|
|
@@ -1439,7 +1433,7 @@ export const promise: <A>(
|
|
|
1439
1433
|
* ```
|
|
1440
1434
|
*
|
|
1441
1435
|
* @see {@link promise} if the effectful computation is asynchronous and does not throw errors.
|
|
1442
|
-
* @category
|
|
1436
|
+
* @category constructors
|
|
1443
1437
|
* @since 2.0.0
|
|
1444
1438
|
*/
|
|
1445
1439
|
export const tryPromise: <A, E = Cause.UnknownError>(
|
|
@@ -1453,8 +1447,8 @@ export const tryPromise: <A, E = Cause.UnknownError>(
|
|
|
1453
1447
|
*
|
|
1454
1448
|
* **When to use**
|
|
1455
1449
|
*
|
|
1456
|
-
* Use when
|
|
1457
|
-
*
|
|
1450
|
+
* Use when an effect should complete successfully with a specific value without any errors
|
|
1451
|
+
* or external dependencies.
|
|
1458
1452
|
*
|
|
1459
1453
|
* **Example** (Creating a successful effect)
|
|
1460
1454
|
*
|
|
@@ -1469,7 +1463,7 @@ export const tryPromise: <A, E = Cause.UnknownError>(
|
|
|
1469
1463
|
* ```
|
|
1470
1464
|
*
|
|
1471
1465
|
* @see {@link fail} to create an effect that represents a failure.
|
|
1472
|
-
* @category
|
|
1466
|
+
* @category constructors
|
|
1473
1467
|
* @since 2.0.0
|
|
1474
1468
|
*/
|
|
1475
1469
|
export const succeed: <A>(value: A) => Effect<A> = internal.succeed
|
|
@@ -1488,7 +1482,7 @@ export const succeed: <A>(value: A) => Effect<A> = internal.succeed
|
|
|
1488
1482
|
* // Output: { _id: 'Option', _tag: 'None' }
|
|
1489
1483
|
* ```
|
|
1490
1484
|
*
|
|
1491
|
-
* @category
|
|
1485
|
+
* @category constructors
|
|
1492
1486
|
* @since 2.0.0
|
|
1493
1487
|
*/
|
|
1494
1488
|
export const succeedNone: Effect<Option<never>> = internal.succeedNone
|
|
@@ -1507,7 +1501,7 @@ export const succeedNone: Effect<Option<never>> = internal.succeedNone
|
|
|
1507
1501
|
* // Output: { _id: 'Option', _tag: 'Some', value: 42 }
|
|
1508
1502
|
* ```
|
|
1509
1503
|
*
|
|
1510
|
-
* @category
|
|
1504
|
+
* @category constructors
|
|
1511
1505
|
* @since 2.0.0
|
|
1512
1506
|
*/
|
|
1513
1507
|
export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedSome
|
|
@@ -1517,14 +1511,16 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
|
|
|
1517
1511
|
*
|
|
1518
1512
|
* **When to use**
|
|
1519
1513
|
*
|
|
1520
|
-
* Use when you need to defer the evaluation of an effect until it is required.
|
|
1514
|
+
* Use when you need to defer the evaluation of an effect until it is required.
|
|
1521
1515
|
*
|
|
1522
1516
|
* **Details**
|
|
1523
1517
|
*
|
|
1524
|
-
* `suspend` takes a thunk that represents
|
|
1525
|
-
*
|
|
1526
|
-
*
|
|
1527
|
-
*
|
|
1518
|
+
* `suspend` takes a thunk that represents an effect and delays creating it
|
|
1519
|
+
* until the suspended effect is evaluated. This is useful for optimizing
|
|
1520
|
+
* expensive computations, managing circular dependencies such as recursive
|
|
1521
|
+
* functions, and helping TypeScript unify return types when branches construct
|
|
1522
|
+
* different effects. Any side effects or scoped captures inside the thunk are
|
|
1523
|
+
* re-executed on each invocation.
|
|
1528
1524
|
*
|
|
1529
1525
|
* **Example** (Lazily evaluating side effects)
|
|
1530
1526
|
*
|
|
@@ -1595,7 +1591,7 @@ export const succeedSome: <A>(value: A) => Effect<Option<A>> = internal.succeedS
|
|
|
1595
1591
|
* )
|
|
1596
1592
|
* ```
|
|
1597
1593
|
*
|
|
1598
|
-
* @category
|
|
1594
|
+
* @category constructors
|
|
1599
1595
|
* @since 2.0.0
|
|
1600
1596
|
*/
|
|
1601
1597
|
export const suspend: <A, E, R>(
|
|
@@ -1607,7 +1603,8 @@ export const suspend: <A, E, R>(
|
|
|
1607
1603
|
*
|
|
1608
1604
|
* **When to use**
|
|
1609
1605
|
*
|
|
1610
|
-
* Use when you
|
|
1606
|
+
* Use when you need to wrap a synchronous side-effectful operation that is not
|
|
1607
|
+
* expected to throw.
|
|
1611
1608
|
*
|
|
1612
1609
|
* **Details**
|
|
1613
1610
|
*
|
|
@@ -1634,7 +1631,7 @@ export const suspend: <A, E, R>(
|
|
|
1634
1631
|
* ```
|
|
1635
1632
|
*
|
|
1636
1633
|
* @see {@link try_ | try} for a version that can handle failures.
|
|
1637
|
-
* @category
|
|
1634
|
+
* @category constructors
|
|
1638
1635
|
* @since 2.0.0
|
|
1639
1636
|
*/
|
|
1640
1637
|
export const sync: <A>(thunk: LazyArg<A>) => Effect<A> = internal.sync
|
|
@@ -1644,7 +1641,7 @@ export {
|
|
|
1644
1641
|
/**
|
|
1645
1642
|
* Returns an effect that succeeds with `void`.
|
|
1646
1643
|
*
|
|
1647
|
-
* @category
|
|
1644
|
+
* @category constructors
|
|
1648
1645
|
* @since 2.0.0
|
|
1649
1646
|
*/
|
|
1650
1647
|
void_ as void
|
|
@@ -1655,7 +1652,7 @@ export {
|
|
|
1655
1652
|
/**
|
|
1656
1653
|
* Returns an effect that succeeds with `undefined`.
|
|
1657
1654
|
*
|
|
1658
|
-
* @category
|
|
1655
|
+
* @category constructors
|
|
1659
1656
|
* @since 4.0.0
|
|
1660
1657
|
*/
|
|
1661
1658
|
undefined_ as undefined
|
|
@@ -1666,8 +1663,8 @@ export {
|
|
|
1666
1663
|
*
|
|
1667
1664
|
* **When to use**
|
|
1668
1665
|
*
|
|
1669
|
-
* Use when
|
|
1670
|
-
*
|
|
1666
|
+
* Use when you need to integrate APIs that complete through callbacks instead
|
|
1667
|
+
* of returning a `Promise`.
|
|
1671
1668
|
*
|
|
1672
1669
|
* **Details**
|
|
1673
1670
|
*
|
|
@@ -1693,7 +1690,7 @@ export {
|
|
|
1693
1690
|
* const program = delay(1000)
|
|
1694
1691
|
* ```
|
|
1695
1692
|
*
|
|
1696
|
-
* @category
|
|
1693
|
+
* @category constructors
|
|
1697
1694
|
* @since 4.0.0
|
|
1698
1695
|
*/
|
|
1699
1696
|
export const callback: <A, E = never, R = never>(
|
|
@@ -1723,7 +1720,7 @@ export const callback: <A, E = never, R = never>(
|
|
|
1723
1720
|
* const timedProgram = Effect.timeout(program, "1 second")
|
|
1724
1721
|
* ```
|
|
1725
1722
|
*
|
|
1726
|
-
* @category
|
|
1723
|
+
* @category constructors
|
|
1727
1724
|
* @since 2.0.0
|
|
1728
1725
|
*/
|
|
1729
1726
|
export const never: Effect<never> = internal.never
|
|
@@ -1934,14 +1931,13 @@ export const bind: {
|
|
|
1934
1931
|
*
|
|
1935
1932
|
* **When to use**
|
|
1936
1933
|
*
|
|
1937
|
-
* Use when
|
|
1938
|
-
* code,
|
|
1939
|
-
*
|
|
1940
|
-
* and easier to manage.
|
|
1934
|
+
* Use when you want to write effectful code that looks and behaves like
|
|
1935
|
+
* synchronous code, while still handling asynchronous tasks, errors, and complex
|
|
1936
|
+
* control flow such as loops and conditions.
|
|
1941
1937
|
*
|
|
1942
|
-
*
|
|
1943
|
-
*
|
|
1944
|
-
* effects and return the final result at the end.
|
|
1938
|
+
* Generator functions work similarly to `async/await` but keep errors,
|
|
1939
|
+
* requirements, and interruption in the Effect type. You can `yield*` values
|
|
1940
|
+
* from effects and return the final result at the end.
|
|
1945
1941
|
*
|
|
1946
1942
|
* **Example** (Sequencing effects with generators)
|
|
1947
1943
|
*
|
|
@@ -1976,7 +1972,7 @@ export const bind: {
|
|
|
1976
1972
|
* })
|
|
1977
1973
|
* ```
|
|
1978
1974
|
*
|
|
1979
|
-
* @category
|
|
1975
|
+
* @category constructors
|
|
1980
1976
|
* @since 2.0.0
|
|
1981
1977
|
*/
|
|
1982
1978
|
export const gen: {
|
|
@@ -1986,14 +1982,13 @@ export const gen: {
|
|
|
1986
1982
|
*
|
|
1987
1983
|
* **When to use**
|
|
1988
1984
|
*
|
|
1989
|
-
* Use when
|
|
1990
|
-
* code,
|
|
1991
|
-
*
|
|
1992
|
-
* and easier to manage.
|
|
1985
|
+
* Use when you want to write effectful code that looks and behaves like
|
|
1986
|
+
* synchronous code, while still handling asynchronous tasks, errors, and complex
|
|
1987
|
+
* control flow such as loops and conditions.
|
|
1993
1988
|
*
|
|
1994
|
-
*
|
|
1995
|
-
*
|
|
1996
|
-
* effects and return the final result at the end.
|
|
1989
|
+
* Generator functions work similarly to `async/await` but keep errors,
|
|
1990
|
+
* requirements, and interruption in the Effect type. You can `yield*` values
|
|
1991
|
+
* from effects and return the final result at the end.
|
|
1997
1992
|
*
|
|
1998
1993
|
* **Example** (Sequencing effects with generators)
|
|
1999
1994
|
*
|
|
@@ -2028,7 +2023,7 @@ export const gen: {
|
|
|
2028
2023
|
* })
|
|
2029
2024
|
* ```
|
|
2030
2025
|
*
|
|
2031
|
-
* @category
|
|
2026
|
+
* @category constructors
|
|
2032
2027
|
* @since 2.0.0
|
|
2033
2028
|
*/
|
|
2034
2029
|
<Eff extends Effect<any, any, any>, AEff>(f: () => Generator<Eff, AEff, never>): Effect<
|
|
@@ -2046,14 +2041,13 @@ export const gen: {
|
|
|
2046
2041
|
*
|
|
2047
2042
|
* **When to use**
|
|
2048
2043
|
*
|
|
2049
|
-
* Use when
|
|
2050
|
-
* code,
|
|
2051
|
-
*
|
|
2052
|
-
* and easier to manage.
|
|
2044
|
+
* Use when you want to write effectful code that looks and behaves like
|
|
2045
|
+
* synchronous code, while still handling asynchronous tasks, errors, and complex
|
|
2046
|
+
* control flow such as loops and conditions.
|
|
2053
2047
|
*
|
|
2054
|
-
*
|
|
2055
|
-
*
|
|
2056
|
-
* effects and return the final result at the end.
|
|
2048
|
+
* Generator functions work similarly to `async/await` but keep errors,
|
|
2049
|
+
* requirements, and interruption in the Effect type. You can `yield*` values
|
|
2050
|
+
* from effects and return the final result at the end.
|
|
2057
2051
|
*
|
|
2058
2052
|
* **Example** (Sequencing effects with generators)
|
|
2059
2053
|
*
|
|
@@ -2088,7 +2082,7 @@ export const gen: {
|
|
|
2088
2082
|
* })
|
|
2089
2083
|
* ```
|
|
2090
2084
|
*
|
|
2091
|
-
* @category
|
|
2085
|
+
* @category constructors
|
|
2092
2086
|
* @since 2.0.0
|
|
2093
2087
|
*/
|
|
2094
2088
|
<Self, Eff extends Effect<any, any, any>, AEff>(
|
|
@@ -2116,7 +2110,7 @@ export declare namespace gen {
|
|
|
2116
2110
|
/**
|
|
2117
2111
|
* Generator return type accepted by `Effect.gen`.
|
|
2118
2112
|
*
|
|
2119
|
-
* @category
|
|
2113
|
+
* @category constructors
|
|
2120
2114
|
* @since 4.0.0
|
|
2121
2115
|
*/
|
|
2122
2116
|
export type Return<A, E = never, R = never> = Generator<Effect<any, E, R>, A, any>
|
|
@@ -2127,9 +2121,12 @@ export declare namespace gen {
|
|
|
2127
2121
|
*
|
|
2128
2122
|
* **When to use**
|
|
2129
2123
|
*
|
|
2130
|
-
* Use to explicitly signal
|
|
2131
|
-
*
|
|
2132
|
-
*
|
|
2124
|
+
* Use to explicitly signal a recoverable error in an `Effect`.
|
|
2125
|
+
*
|
|
2126
|
+
* **Details**
|
|
2127
|
+
*
|
|
2128
|
+
* The error keeps propagating unless it is handled. You can handle tagged
|
|
2129
|
+
* errors with functions like {@link catchTag} or {@link catchTags}.
|
|
2133
2130
|
*
|
|
2134
2131
|
* **Example** (Creating a failed effect)
|
|
2135
2132
|
*
|
|
@@ -2146,7 +2143,7 @@ export declare namespace gen {
|
|
|
2146
2143
|
* ```
|
|
2147
2144
|
*
|
|
2148
2145
|
* @see {@link succeed} to create an effect that represents a successful value.
|
|
2149
|
-
* @category
|
|
2146
|
+
* @category constructors
|
|
2150
2147
|
* @since 2.0.0
|
|
2151
2148
|
*/
|
|
2152
2149
|
export const fail: <E>(error: E) => Effect<never, E> = internal.fail
|
|
@@ -2175,7 +2172,7 @@ export const fail: <E>(error: E) => Effect<never, E> = internal.fail
|
|
|
2175
2172
|
* // Output: { _id: 'Exit', _tag: 'Failure', cause: ... }
|
|
2176
2173
|
* ```
|
|
2177
2174
|
*
|
|
2178
|
-
* @category
|
|
2175
|
+
* @category constructors
|
|
2179
2176
|
* @since 2.0.0
|
|
2180
2177
|
*/
|
|
2181
2178
|
export const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E> = internal.failSync
|
|
@@ -2183,6 +2180,12 @@ export const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E> = internal.
|
|
|
2183
2180
|
/**
|
|
2184
2181
|
* Creates an `Effect` that represents a failure with a specific `Cause`.
|
|
2185
2182
|
*
|
|
2183
|
+
* **When to use**
|
|
2184
|
+
*
|
|
2185
|
+
* Use when you already have a full `Cause` and need to preserve defects,
|
|
2186
|
+
* interruptions, annotations, or combined failures in the effect's failure
|
|
2187
|
+
* channel.
|
|
2188
|
+
*
|
|
2186
2189
|
* **Details**
|
|
2187
2190
|
*
|
|
2188
2191
|
* This function allows you to create effects that fail with complex error
|
|
@@ -2201,7 +2204,7 @@ export const failSync: <E>(evaluate: LazyArg<E>) => Effect<never, E> = internal.
|
|
|
2201
2204
|
* // Output: { _id: 'Exit', _tag: 'Failure', cause: ... }
|
|
2202
2205
|
* ```
|
|
2203
2206
|
*
|
|
2204
|
-
* @category
|
|
2207
|
+
* @category constructors
|
|
2205
2208
|
* @since 2.0.0
|
|
2206
2209
|
*/
|
|
2207
2210
|
export const failCause: <E>(cause: Cause.Cause<E>) => Effect<never, E> = internal.failCause
|
|
@@ -2230,7 +2233,7 @@ export const failCause: <E>(cause: Cause.Cause<E>) => Effect<never, E> = interna
|
|
|
2230
2233
|
* // Output: { _id: 'Exit', _tag: 'Failure', cause: ... }
|
|
2231
2234
|
* ```
|
|
2232
2235
|
*
|
|
2233
|
-
* @category
|
|
2236
|
+
* @category constructors
|
|
2234
2237
|
* @since 2.0.0
|
|
2235
2238
|
*/
|
|
2236
2239
|
export const failCauseSync: <E>(
|
|
@@ -2242,8 +2245,8 @@ export const failCauseSync: <E>(
|
|
|
2242
2245
|
*
|
|
2243
2246
|
* **When to use**
|
|
2244
2247
|
*
|
|
2245
|
-
* Use when
|
|
2246
|
-
*
|
|
2248
|
+
* Use when you need an `Effect` to report an unrecoverable defect instead of a
|
|
2249
|
+
* typed error.
|
|
2247
2250
|
*
|
|
2248
2251
|
* **Details**
|
|
2249
2252
|
*
|
|
@@ -2274,7 +2277,7 @@ export const failCauseSync: <E>(
|
|
|
2274
2277
|
* // ...stack trace...
|
|
2275
2278
|
* ```
|
|
2276
2279
|
*
|
|
2277
|
-
* @category
|
|
2280
|
+
* @category constructors
|
|
2278
2281
|
* @since 2.0.0
|
|
2279
2282
|
*/
|
|
2280
2283
|
export const die: (defect: unknown) => Effect<never> = internal.die
|
|
@@ -2291,10 +2294,8 @@ export {
|
|
|
2291
2294
|
*
|
|
2292
2295
|
* **When to use**
|
|
2293
2296
|
*
|
|
2294
|
-
* Use when
|
|
2295
|
-
*
|
|
2296
|
-
* constructor is designed to handle operations that could throw exceptions by
|
|
2297
|
-
* capturing those exceptions and transforming them into manageable errors.
|
|
2297
|
+
* Use when you need to perform synchronous operations that might throw, such
|
|
2298
|
+
* as parsing JSON, and convert thrown exceptions into typed Effect failures.
|
|
2298
2299
|
*
|
|
2299
2300
|
* **Details**
|
|
2300
2301
|
*
|
|
@@ -2346,7 +2347,7 @@ export {
|
|
|
2346
2347
|
*
|
|
2347
2348
|
* @see {@link sync} if the effectful computation is synchronous and does not
|
|
2348
2349
|
* throw errors.
|
|
2349
|
-
* @category
|
|
2350
|
+
* @category constructors
|
|
2350
2351
|
* @since 2.0.0
|
|
2351
2352
|
*/
|
|
2352
2353
|
try_ as try
|
|
@@ -2369,7 +2370,7 @@ export {
|
|
|
2369
2370
|
* Effect.runPromise(program)
|
|
2370
2371
|
* ```
|
|
2371
2372
|
*
|
|
2372
|
-
* @category
|
|
2373
|
+
* @category constructors
|
|
2373
2374
|
* @since 2.0.0
|
|
2374
2375
|
*/
|
|
2375
2376
|
export const yieldNow: Effect<void> = internal.yieldNow
|
|
@@ -2391,7 +2392,7 @@ export const yieldNow: Effect<void> = internal.yieldNow
|
|
|
2391
2392
|
* Effect.runPromise(program)
|
|
2392
2393
|
* ```
|
|
2393
2394
|
*
|
|
2394
|
-
* @category
|
|
2395
|
+
* @category constructors
|
|
2395
2396
|
* @since 4.0.0
|
|
2396
2397
|
*/
|
|
2397
2398
|
export const yieldNowWith: (priority?: number) => Effect<void> = internal.yieldNowWith
|
|
@@ -2412,7 +2413,7 @@ export const yieldNowWith: (priority?: number) => Effect<void> = internal.yieldN
|
|
|
2412
2413
|
* // Output: Fiber ID: 1
|
|
2413
2414
|
* ```
|
|
2414
2415
|
*
|
|
2415
|
-
* @category
|
|
2416
|
+
* @category constructors
|
|
2416
2417
|
* @since 4.0.0
|
|
2417
2418
|
*/
|
|
2418
2419
|
export const withFiber: <A, E = never, R = never>(
|
|
@@ -2450,6 +2451,11 @@ export const fromResult: <A, E>(result: Result.Result<A, E>) => Effect<A, E> = i
|
|
|
2450
2451
|
/**
|
|
2451
2452
|
* Converts an `Option` into an `Effect`.
|
|
2452
2453
|
*
|
|
2454
|
+
* **When to use**
|
|
2455
|
+
*
|
|
2456
|
+
* Use when absence should become a typed `NoSuchElementError` in the effect error
|
|
2457
|
+
* channel.
|
|
2458
|
+
*
|
|
2453
2459
|
* **Details**
|
|
2454
2460
|
*
|
|
2455
2461
|
* `Option.some` becomes a successful effect with the contained value, while
|
|
@@ -2749,8 +2755,8 @@ export const flatten: <A, E, R, E2, R2>(self: Effect<Effect<A, E, R>, E2, R2>) =
|
|
|
2749
2755
|
*
|
|
2750
2756
|
* **When to use**
|
|
2751
2757
|
*
|
|
2752
|
-
* Use when one effect
|
|
2753
|
-
*
|
|
2758
|
+
* Use when you need one effect to run after another and the second effect may
|
|
2759
|
+
* depend on the first effect's success value.
|
|
2754
2760
|
*
|
|
2755
2761
|
* **Details**
|
|
2756
2762
|
*
|
|
@@ -2825,8 +2831,8 @@ export const andThen: {
|
|
|
2825
2831
|
*
|
|
2826
2832
|
* **When to use**
|
|
2827
2833
|
*
|
|
2828
|
-
* Use when one effect
|
|
2829
|
-
*
|
|
2834
|
+
* Use when you need one effect to run after another and the second effect may
|
|
2835
|
+
* depend on the first effect's success value.
|
|
2830
2836
|
*
|
|
2831
2837
|
* **Details**
|
|
2832
2838
|
*
|
|
@@ -2901,8 +2907,8 @@ export const andThen: {
|
|
|
2901
2907
|
*
|
|
2902
2908
|
* **When to use**
|
|
2903
2909
|
*
|
|
2904
|
-
* Use when one effect
|
|
2905
|
-
*
|
|
2910
|
+
* Use when you need one effect to run after another and the second effect may
|
|
2911
|
+
* depend on the first effect's success value.
|
|
2906
2912
|
*
|
|
2907
2913
|
* **Details**
|
|
2908
2914
|
*
|
|
@@ -2977,8 +2983,8 @@ export const andThen: {
|
|
|
2977
2983
|
*
|
|
2978
2984
|
* **When to use**
|
|
2979
2985
|
*
|
|
2980
|
-
* Use when one effect
|
|
2981
|
-
*
|
|
2986
|
+
* Use when you need one effect to run after another and the second effect may
|
|
2987
|
+
* depend on the first effect's success value.
|
|
2982
2988
|
*
|
|
2983
2989
|
* **Details**
|
|
2984
2990
|
*
|
|
@@ -3053,8 +3059,8 @@ export const andThen: {
|
|
|
3053
3059
|
*
|
|
3054
3060
|
* **When to use**
|
|
3055
3061
|
*
|
|
3056
|
-
* Use when one effect
|
|
3057
|
-
*
|
|
3062
|
+
* Use when you need one effect to run after another and the second effect may
|
|
3063
|
+
* depend on the first effect's success value.
|
|
3058
3064
|
*
|
|
3059
3065
|
* **Details**
|
|
3060
3066
|
*
|
|
@@ -3131,9 +3137,8 @@ export const andThen: {
|
|
|
3131
3137
|
*
|
|
3132
3138
|
* **When to use**
|
|
3133
3139
|
*
|
|
3134
|
-
* Use when you
|
|
3135
|
-
*
|
|
3136
|
-
* record an action but want the original value to be passed to the next step.
|
|
3140
|
+
* Use when you need to run an effectful observation, such as logging or
|
|
3141
|
+
* tracking, while passing the original success value to the next step.
|
|
3137
3142
|
*
|
|
3138
3143
|
* **Details**
|
|
3139
3144
|
*
|
|
@@ -3185,9 +3190,8 @@ export const tap: {
|
|
|
3185
3190
|
*
|
|
3186
3191
|
* **When to use**
|
|
3187
3192
|
*
|
|
3188
|
-
* Use when you
|
|
3189
|
-
*
|
|
3190
|
-
* record an action but want the original value to be passed to the next step.
|
|
3193
|
+
* Use when you need to run an effectful observation, such as logging or
|
|
3194
|
+
* tracking, while passing the original success value to the next step.
|
|
3191
3195
|
*
|
|
3192
3196
|
* **Details**
|
|
3193
3197
|
*
|
|
@@ -3239,9 +3243,8 @@ export const tap: {
|
|
|
3239
3243
|
*
|
|
3240
3244
|
* **When to use**
|
|
3241
3245
|
*
|
|
3242
|
-
* Use when you
|
|
3243
|
-
*
|
|
3244
|
-
* record an action but want the original value to be passed to the next step.
|
|
3246
|
+
* Use when you need to run an effectful observation, such as logging or
|
|
3247
|
+
* tracking, while passing the original success value to the next step.
|
|
3245
3248
|
*
|
|
3246
3249
|
* **Details**
|
|
3247
3250
|
*
|
|
@@ -3293,9 +3296,8 @@ export const tap: {
|
|
|
3293
3296
|
*
|
|
3294
3297
|
* **When to use**
|
|
3295
3298
|
*
|
|
3296
|
-
* Use when you
|
|
3297
|
-
*
|
|
3298
|
-
* record an action but want the original value to be passed to the next step.
|
|
3299
|
+
* Use when you need to run an effectful observation, such as logging or
|
|
3300
|
+
* tracking, while passing the original success value to the next step.
|
|
3299
3301
|
*
|
|
3300
3302
|
* **Details**
|
|
3301
3303
|
*
|
|
@@ -3347,9 +3349,8 @@ export const tap: {
|
|
|
3347
3349
|
*
|
|
3348
3350
|
* **When to use**
|
|
3349
3351
|
*
|
|
3350
|
-
* Use when you
|
|
3351
|
-
*
|
|
3352
|
-
* record an action but want the original value to be passed to the next step.
|
|
3352
|
+
* Use when you need to run an effectful observation, such as logging or
|
|
3353
|
+
* tracking, while passing the original success value to the next step.
|
|
3353
3354
|
*
|
|
3354
3355
|
* **Details**
|
|
3355
3356
|
*
|
|
@@ -3402,16 +3403,15 @@ export const tap: {
|
|
|
3402
3403
|
*
|
|
3403
3404
|
* **When to use**
|
|
3404
3405
|
*
|
|
3405
|
-
* Use when you want
|
|
3406
|
-
* the original error value.
|
|
3407
|
-
* succeeded, and `exit` when you need the full failure cause.
|
|
3406
|
+
* Use when you want an `Effect`'s typed failures to be handled as `Result`
|
|
3407
|
+
* data while preserving the original error value.
|
|
3408
3408
|
*
|
|
3409
3409
|
* **Details**
|
|
3410
3410
|
*
|
|
3411
3411
|
* This function converts an effect that may fail into an effect that always
|
|
3412
3412
|
* succeeds, wrapping the outcome in a `Result` type. The result will be
|
|
3413
|
-
* `Result.
|
|
3414
|
-
* `Result.
|
|
3413
|
+
* `Result.Failure` if the effect fails, containing the recoverable error, or
|
|
3414
|
+
* `Result.Success` if it succeeds, containing the result.
|
|
3415
3415
|
*
|
|
3416
3416
|
* Using this function, you can handle recoverable errors explicitly without
|
|
3417
3417
|
* causing the effect to fail. This is particularly useful in scenarios where
|
|
@@ -3458,9 +3458,8 @@ export const result: <A, E, R>(self: Effect<A, E, R>) => Effect<Result.Result<A,
|
|
|
3458
3458
|
*
|
|
3459
3459
|
* **When to use**
|
|
3460
3460
|
*
|
|
3461
|
-
* Use when
|
|
3462
|
-
*
|
|
3463
|
-
* need the full failure cause.
|
|
3461
|
+
* Use when you only care whether an effect succeeds and want recoverable
|
|
3462
|
+
* failures represented as `Option.none`.
|
|
3464
3463
|
*
|
|
3465
3464
|
* **Details**
|
|
3466
3465
|
*
|
|
@@ -3508,9 +3507,8 @@ export const option: <A, E, R>(self: Effect<A, E, R>) => Effect<Option<A>, never
|
|
|
3508
3507
|
*
|
|
3509
3508
|
* **When to use**
|
|
3510
3509
|
*
|
|
3511
|
-
* Use when you need to inspect the full outcome, including typed
|
|
3512
|
-
*
|
|
3513
|
-
* need to handle typed failures.
|
|
3510
|
+
* Use when you need to inspect the full outcome, including typed failures, defects,
|
|
3511
|
+
* and interruptions.
|
|
3514
3512
|
*
|
|
3515
3513
|
* **Details**
|
|
3516
3514
|
*
|
|
@@ -3860,8 +3858,7 @@ export const asVoid: <A, E, R>(self: Effect<A, E, R>) => Effect<void, E, R> = in
|
|
|
3860
3858
|
*
|
|
3861
3859
|
* **When to use**
|
|
3862
3860
|
*
|
|
3863
|
-
* Use to
|
|
3864
|
-
* into the failure channel.
|
|
3861
|
+
* Use to swap an `Effect`'s success and failure channels.
|
|
3865
3862
|
*
|
|
3866
3863
|
* **Details**
|
|
3867
3864
|
*
|
|
@@ -4305,6 +4302,11 @@ export {
|
|
|
4305
4302
|
/**
|
|
4306
4303
|
* Handles all errors in an effect by providing a fallback effect.
|
|
4307
4304
|
*
|
|
4305
|
+
* **When to use**
|
|
4306
|
+
*
|
|
4307
|
+
* Use when every recoverable error from an effect should be handled by the same
|
|
4308
|
+
* fallback function while unrecoverable defects remain defects.
|
|
4309
|
+
*
|
|
4308
4310
|
* **Details**
|
|
4309
4311
|
*
|
|
4310
4312
|
* The `catch` function catches any errors that may occur during the
|
|
@@ -4312,8 +4314,10 @@ export {
|
|
|
4312
4314
|
* effect. This ensures that the program continues without failing by recovering
|
|
4313
4315
|
* from errors using the provided fallback logic.
|
|
4314
4316
|
*
|
|
4315
|
-
* **
|
|
4316
|
-
*
|
|
4317
|
+
* **Gotchas**
|
|
4318
|
+
*
|
|
4319
|
+
* `catch` only handles recoverable errors. It will not recover from
|
|
4320
|
+
* unrecoverable defects.
|
|
4317
4321
|
*
|
|
4318
4322
|
* @see {@link catchCause} for a version that can recover from both recoverable and unrecoverable errors.
|
|
4319
4323
|
*
|
|
@@ -4329,8 +4333,8 @@ export {
|
|
|
4329
4333
|
*
|
|
4330
4334
|
* **When to use**
|
|
4331
4335
|
*
|
|
4332
|
-
* Use when
|
|
4333
|
-
* channel.
|
|
4336
|
+
* Use when you need to recover from one specific tagged error in an effect
|
|
4337
|
+
* error channel.
|
|
4334
4338
|
*
|
|
4335
4339
|
* **Details**
|
|
4336
4340
|
*
|
|
@@ -4374,8 +4378,8 @@ export const catchTag: {
|
|
|
4374
4378
|
*
|
|
4375
4379
|
* **When to use**
|
|
4376
4380
|
*
|
|
4377
|
-
* Use when
|
|
4378
|
-
* channel.
|
|
4381
|
+
* Use when you need to recover from one specific tagged error in an effect
|
|
4382
|
+
* error channel.
|
|
4379
4383
|
*
|
|
4380
4384
|
* **Details**
|
|
4381
4385
|
*
|
|
@@ -4442,8 +4446,8 @@ export const catchTag: {
|
|
|
4442
4446
|
*
|
|
4443
4447
|
* **When to use**
|
|
4444
4448
|
*
|
|
4445
|
-
* Use when
|
|
4446
|
-
* channel.
|
|
4449
|
+
* Use when you need to recover from one specific tagged error in an effect
|
|
4450
|
+
* error channel.
|
|
4447
4451
|
*
|
|
4448
4452
|
* **Details**
|
|
4449
4453
|
*
|
|
@@ -4513,10 +4517,14 @@ export const catchTag: {
|
|
|
4513
4517
|
* **When to use**
|
|
4514
4518
|
*
|
|
4515
4519
|
* Use when one recovery step should handle several tagged error types by
|
|
4516
|
-
* matching their readonly `_tag` fields.
|
|
4517
|
-
* tags, plus an optional fallback for unmatched errors.
|
|
4520
|
+
* matching their readonly `_tag` fields.
|
|
4518
4521
|
*
|
|
4519
|
-
*
|
|
4522
|
+
* **Details**
|
|
4523
|
+
*
|
|
4524
|
+
* Pass a handler table whose keys are tags, plus an optional fallback for
|
|
4525
|
+
* unmatched errors.
|
|
4526
|
+
*
|
|
4527
|
+
* The error type must have a readonly `_tag` field to use `catchTags`. This
|
|
4520
4528
|
* field is used to identify and match errors.
|
|
4521
4529
|
*
|
|
4522
4530
|
* **Example** (Handling multiple tagged errors)
|
|
@@ -4554,10 +4562,14 @@ export const catchTags: {
|
|
|
4554
4562
|
* **When to use**
|
|
4555
4563
|
*
|
|
4556
4564
|
* Use when one recovery step should handle several tagged error types by
|
|
4557
|
-
* matching their readonly `_tag` fields.
|
|
4558
|
-
*
|
|
4565
|
+
* matching their readonly `_tag` fields.
|
|
4566
|
+
*
|
|
4567
|
+
* **Details**
|
|
4559
4568
|
*
|
|
4560
|
-
*
|
|
4569
|
+
* Pass a handler table whose keys are tags, plus an optional fallback for
|
|
4570
|
+
* unmatched errors.
|
|
4571
|
+
*
|
|
4572
|
+
* The error type must have a readonly `_tag` field to use `catchTags`. This
|
|
4561
4573
|
* field is used to identify and match errors.
|
|
4562
4574
|
*
|
|
4563
4575
|
* **Example** (Handling multiple tagged errors)
|
|
@@ -4624,10 +4636,14 @@ export const catchTags: {
|
|
|
4624
4636
|
* **When to use**
|
|
4625
4637
|
*
|
|
4626
4638
|
* Use when one recovery step should handle several tagged error types by
|
|
4627
|
-
* matching their readonly `_tag` fields.
|
|
4628
|
-
*
|
|
4639
|
+
* matching their readonly `_tag` fields.
|
|
4640
|
+
*
|
|
4641
|
+
* **Details**
|
|
4629
4642
|
*
|
|
4630
|
-
*
|
|
4643
|
+
* Pass a handler table whose keys are tags, plus an optional fallback for
|
|
4644
|
+
* unmatched errors.
|
|
4645
|
+
*
|
|
4646
|
+
* The error type must have a readonly `_tag` field to use `catchTags`. This
|
|
4631
4647
|
* field is used to identify and match errors.
|
|
4632
4648
|
*
|
|
4633
4649
|
* **Example** (Handling multiple tagged errors)
|
|
@@ -4696,8 +4712,8 @@ export const catchTags: {
|
|
|
4696
4712
|
*
|
|
4697
4713
|
* **When to use**
|
|
4698
4714
|
*
|
|
4699
|
-
* Use to handle one nested reason inside
|
|
4700
|
-
* parent error shape for unmatched reasons.
|
|
4715
|
+
* Use to handle one nested reason inside an `Effect`'s tagged error while
|
|
4716
|
+
* preserving the parent error shape for unmatched reasons.
|
|
4701
4717
|
*
|
|
4702
4718
|
* **Details**
|
|
4703
4719
|
*
|
|
@@ -4742,8 +4758,8 @@ export const catchReason: {
|
|
|
4742
4758
|
*
|
|
4743
4759
|
* **When to use**
|
|
4744
4760
|
*
|
|
4745
|
-
* Use to handle one nested reason inside
|
|
4746
|
-
* parent error shape for unmatched reasons.
|
|
4761
|
+
* Use to handle one nested reason inside an `Effect`'s tagged error while
|
|
4762
|
+
* preserving the parent error shape for unmatched reasons.
|
|
4747
4763
|
*
|
|
4748
4764
|
* **Details**
|
|
4749
4765
|
*
|
|
@@ -4817,8 +4833,8 @@ export const catchReason: {
|
|
|
4817
4833
|
*
|
|
4818
4834
|
* **When to use**
|
|
4819
4835
|
*
|
|
4820
|
-
* Use to handle one nested reason inside
|
|
4821
|
-
* parent error shape for unmatched reasons.
|
|
4836
|
+
* Use to handle one nested reason inside an `Effect`'s tagged error while
|
|
4837
|
+
* preserving the parent error shape for unmatched reasons.
|
|
4822
4838
|
*
|
|
4823
4839
|
* **Details**
|
|
4824
4840
|
*
|
|
@@ -5211,8 +5227,9 @@ export const unwrapReason: {
|
|
|
5211
5227
|
*
|
|
5212
5228
|
* **When to use**
|
|
5213
5229
|
*
|
|
5214
|
-
* Use when
|
|
5215
|
-
* defects, and interruptions, instead of only
|
|
5230
|
+
* Use when you need to recover from an `Effect` by inspecting the full `Cause`,
|
|
5231
|
+
* including recoverable failures, defects, and interruptions, instead of only
|
|
5232
|
+
* the typed error value.
|
|
5216
5233
|
*
|
|
5217
5234
|
* **Details**
|
|
5218
5235
|
*
|
|
@@ -5251,8 +5268,9 @@ export const catchCause: {
|
|
|
5251
5268
|
*
|
|
5252
5269
|
* **When to use**
|
|
5253
5270
|
*
|
|
5254
|
-
* Use when
|
|
5255
|
-
* defects, and interruptions, instead of only
|
|
5271
|
+
* Use when you need to recover from an `Effect` by inspecting the full `Cause`,
|
|
5272
|
+
* including recoverable failures, defects, and interruptions, instead of only
|
|
5273
|
+
* the typed error value.
|
|
5256
5274
|
*
|
|
5257
5275
|
* **Details**
|
|
5258
5276
|
*
|
|
@@ -5291,8 +5309,9 @@ export const catchCause: {
|
|
|
5291
5309
|
*
|
|
5292
5310
|
* **When to use**
|
|
5293
5311
|
*
|
|
5294
|
-
* Use when
|
|
5295
|
-
* defects, and interruptions, instead of only
|
|
5312
|
+
* Use when you need to recover from an `Effect` by inspecting the full `Cause`,
|
|
5313
|
+
* including recoverable failures, defects, and interruptions, instead of only
|
|
5314
|
+
* the typed error value.
|
|
5296
5315
|
*
|
|
5297
5316
|
* **Details**
|
|
5298
5317
|
*
|
|
@@ -5332,8 +5351,7 @@ export const catchCause: {
|
|
|
5332
5351
|
*
|
|
5333
5352
|
* **When to use**
|
|
5334
5353
|
*
|
|
5335
|
-
* Use when you
|
|
5336
|
-
* reported or translated for an external system.
|
|
5354
|
+
* Use when you need to report or translate defects at integration boundaries.
|
|
5337
5355
|
*
|
|
5338
5356
|
* **Details**
|
|
5339
5357
|
*
|
|
@@ -5373,8 +5391,7 @@ export const catchDefect: {
|
|
|
5373
5391
|
*
|
|
5374
5392
|
* **When to use**
|
|
5375
5393
|
*
|
|
5376
|
-
* Use when you
|
|
5377
|
-
* reported or translated for an external system.
|
|
5394
|
+
* Use when you need to report or translate defects at integration boundaries.
|
|
5378
5395
|
*
|
|
5379
5396
|
* **Details**
|
|
5380
5397
|
*
|
|
@@ -5414,8 +5431,7 @@ export const catchDefect: {
|
|
|
5414
5431
|
*
|
|
5415
5432
|
* **When to use**
|
|
5416
5433
|
*
|
|
5417
|
-
* Use when you
|
|
5418
|
-
* reported or translated for an external system.
|
|
5434
|
+
* Use when you need to report or translate defects at integration boundaries.
|
|
5419
5435
|
*
|
|
5420
5436
|
* **Details**
|
|
5421
5437
|
*
|
|
@@ -5457,8 +5473,11 @@ export const catchDefect: {
|
|
|
5457
5473
|
*
|
|
5458
5474
|
* **When to use**
|
|
5459
5475
|
*
|
|
5460
|
-
* Use when you need to recover from errors that match a condition.
|
|
5461
|
-
*
|
|
5476
|
+
* Use when you need to recover from errors that match a condition.
|
|
5477
|
+
*
|
|
5478
|
+
* **Details**
|
|
5479
|
+
*
|
|
5480
|
+
* Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
5462
5481
|
* matching. Non-matching errors re-fail with the original cause. Defects and
|
|
5463
5482
|
* interrupts are not caught.
|
|
5464
5483
|
*
|
|
@@ -5497,8 +5516,11 @@ export const catchIf: {
|
|
|
5497
5516
|
*
|
|
5498
5517
|
* **When to use**
|
|
5499
5518
|
*
|
|
5500
|
-
* Use when you need to recover from errors that match a condition.
|
|
5501
|
-
*
|
|
5519
|
+
* Use when you need to recover from errors that match a condition.
|
|
5520
|
+
*
|
|
5521
|
+
* **Details**
|
|
5522
|
+
*
|
|
5523
|
+
* Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
5502
5524
|
* matching. Non-matching errors re-fail with the original cause. Defects and
|
|
5503
5525
|
* interrupts are not caught.
|
|
5504
5526
|
*
|
|
@@ -5543,8 +5565,11 @@ export const catchIf: {
|
|
|
5543
5565
|
*
|
|
5544
5566
|
* **When to use**
|
|
5545
5567
|
*
|
|
5546
|
-
* Use when you need to recover from errors that match a condition.
|
|
5547
|
-
*
|
|
5568
|
+
* Use when you need to recover from errors that match a condition.
|
|
5569
|
+
*
|
|
5570
|
+
* **Details**
|
|
5571
|
+
*
|
|
5572
|
+
* Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
5548
5573
|
* matching. Non-matching errors re-fail with the original cause. Defects and
|
|
5549
5574
|
* interrupts are not caught.
|
|
5550
5575
|
*
|
|
@@ -5589,8 +5614,11 @@ export const catchIf: {
|
|
|
5589
5614
|
*
|
|
5590
5615
|
* **When to use**
|
|
5591
5616
|
*
|
|
5592
|
-
* Use when you need to recover from errors that match a condition.
|
|
5593
|
-
*
|
|
5617
|
+
* Use when you need to recover from errors that match a condition.
|
|
5618
|
+
*
|
|
5619
|
+
* **Details**
|
|
5620
|
+
*
|
|
5621
|
+
* Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
5594
5622
|
* matching. Non-matching errors re-fail with the original cause. Defects and
|
|
5595
5623
|
* interrupts are not caught.
|
|
5596
5624
|
*
|
|
@@ -5634,8 +5662,11 @@ export const catchIf: {
|
|
|
5634
5662
|
*
|
|
5635
5663
|
* **When to use**
|
|
5636
5664
|
*
|
|
5637
|
-
* Use when you need to recover from errors that match a condition.
|
|
5638
|
-
*
|
|
5665
|
+
* Use when you need to recover from errors that match a condition.
|
|
5666
|
+
*
|
|
5667
|
+
* **Details**
|
|
5668
|
+
*
|
|
5669
|
+
* Use a `Refinement` for type narrowing or a `Predicate` for simple boolean
|
|
5639
5670
|
* matching. Non-matching errors re-fail with the original cause. Defects and
|
|
5640
5671
|
* interrupts are not caught.
|
|
5641
5672
|
*
|
|
@@ -5769,7 +5800,8 @@ export const catchFilter: {
|
|
|
5769
5800
|
*
|
|
5770
5801
|
* **When to use**
|
|
5771
5802
|
*
|
|
5772
|
-
* Use
|
|
5803
|
+
* Use when you expect missing-value failures and want them to become an
|
|
5804
|
+
* optional success while all other failures keep failing.
|
|
5773
5805
|
*
|
|
5774
5806
|
* **Details**
|
|
5775
5807
|
*
|
|
@@ -5804,7 +5836,7 @@ export const catchNoSuchElement: <A, E, R>(
|
|
|
5804
5836
|
*
|
|
5805
5837
|
* **When to use**
|
|
5806
5838
|
*
|
|
5807
|
-
* Use to recover from full causes selected by a predicate.
|
|
5839
|
+
* Use to recover an `Effect` from full causes selected by a predicate.
|
|
5808
5840
|
*
|
|
5809
5841
|
* **Details**
|
|
5810
5842
|
*
|
|
@@ -5848,7 +5880,7 @@ export const catchCauseIf: {
|
|
|
5848
5880
|
*
|
|
5849
5881
|
* **When to use**
|
|
5850
5882
|
*
|
|
5851
|
-
* Use to recover from full causes selected by a predicate.
|
|
5883
|
+
* Use to recover an `Effect` from full causes selected by a predicate.
|
|
5852
5884
|
*
|
|
5853
5885
|
* **Details**
|
|
5854
5886
|
*
|
|
@@ -5895,7 +5927,7 @@ export const catchCauseIf: {
|
|
|
5895
5927
|
*
|
|
5896
5928
|
* **When to use**
|
|
5897
5929
|
*
|
|
5898
|
-
* Use to recover from full causes selected by a predicate.
|
|
5930
|
+
* Use to recover an `Effect` from full causes selected by a predicate.
|
|
5899
5931
|
*
|
|
5900
5932
|
* **Details**
|
|
5901
5933
|
*
|
|
@@ -5945,8 +5977,9 @@ export const catchCauseIf: {
|
|
|
5945
5977
|
*
|
|
5946
5978
|
* **When to use**
|
|
5947
5979
|
*
|
|
5948
|
-
* Use when you need to recover only from causes selected by a
|
|
5949
|
-
* recovery
|
|
5980
|
+
* Use when you need to recover an `Effect` only from causes selected by a
|
|
5981
|
+
* `Filter`, while giving the recovery both the selected value and the original
|
|
5982
|
+
* `Cause`.
|
|
5950
5983
|
*
|
|
5951
5984
|
* **Details**
|
|
5952
5985
|
*
|
|
@@ -5967,8 +6000,9 @@ export const catchCauseFilter: {
|
|
|
5967
6000
|
*
|
|
5968
6001
|
* **When to use**
|
|
5969
6002
|
*
|
|
5970
|
-
* Use when you need to recover only from causes selected by a
|
|
5971
|
-
* recovery
|
|
6003
|
+
* Use when you need to recover an `Effect` only from causes selected by a
|
|
6004
|
+
* `Filter`, while giving the recovery both the selected value and the original
|
|
6005
|
+
* `Cause`.
|
|
5972
6006
|
*
|
|
5973
6007
|
* **Details**
|
|
5974
6008
|
*
|
|
@@ -5992,8 +6026,9 @@ export const catchCauseFilter: {
|
|
|
5992
6026
|
*
|
|
5993
6027
|
* **When to use**
|
|
5994
6028
|
*
|
|
5995
|
-
* Use when you need to recover only from causes selected by a
|
|
5996
|
-
* recovery
|
|
6029
|
+
* Use when you need to recover an `Effect` only from causes selected by a
|
|
6030
|
+
* `Filter`, while giving the recovery both the selected value and the original
|
|
6031
|
+
* `Cause`.
|
|
5997
6032
|
*
|
|
5998
6033
|
* **Details**
|
|
5999
6034
|
*
|
|
@@ -6020,7 +6055,8 @@ export const catchCauseFilter: {
|
|
|
6020
6055
|
*
|
|
6021
6056
|
* **When to use**
|
|
6022
6057
|
*
|
|
6023
|
-
* Use to translate typed failures while leaving successful values
|
|
6058
|
+
* Use to translate an `Effect`'s typed failures while leaving successful values
|
|
6059
|
+
* unchanged.
|
|
6024
6060
|
*
|
|
6025
6061
|
* **Details**
|
|
6026
6062
|
*
|
|
@@ -6058,7 +6094,8 @@ export const mapError: {
|
|
|
6058
6094
|
*
|
|
6059
6095
|
* **When to use**
|
|
6060
6096
|
*
|
|
6061
|
-
* Use to translate typed failures while leaving successful values
|
|
6097
|
+
* Use to translate an `Effect`'s typed failures while leaving successful values
|
|
6098
|
+
* unchanged.
|
|
6062
6099
|
*
|
|
6063
6100
|
* **Details**
|
|
6064
6101
|
*
|
|
@@ -6096,7 +6133,8 @@ export const mapError: {
|
|
|
6096
6133
|
*
|
|
6097
6134
|
* **When to use**
|
|
6098
6135
|
*
|
|
6099
|
-
* Use to translate typed failures while leaving successful values
|
|
6136
|
+
* Use to translate an `Effect`'s typed failures while leaving successful values
|
|
6137
|
+
* unchanged.
|
|
6100
6138
|
*
|
|
6101
6139
|
* **Details**
|
|
6102
6140
|
*
|
|
@@ -6136,8 +6174,8 @@ export const mapError: {
|
|
|
6136
6174
|
*
|
|
6137
6175
|
* **When to use**
|
|
6138
6176
|
*
|
|
6139
|
-
* Use to transform both success and failure
|
|
6140
|
-
*
|
|
6177
|
+
* Use to transform both success and failure channels of an `Effect` without
|
|
6178
|
+
* changing whether it succeeds or fails.
|
|
6141
6179
|
*
|
|
6142
6180
|
* **Details**
|
|
6143
6181
|
*
|
|
@@ -6177,8 +6215,8 @@ export const mapBoth: {
|
|
|
6177
6215
|
*
|
|
6178
6216
|
* **When to use**
|
|
6179
6217
|
*
|
|
6180
|
-
* Use to transform both success and failure
|
|
6181
|
-
*
|
|
6218
|
+
* Use to transform both success and failure channels of an `Effect` without
|
|
6219
|
+
* changing whether it succeeds or fails.
|
|
6182
6220
|
*
|
|
6183
6221
|
* **Details**
|
|
6184
6222
|
*
|
|
@@ -6220,8 +6258,8 @@ export const mapBoth: {
|
|
|
6220
6258
|
*
|
|
6221
6259
|
* **When to use**
|
|
6222
6260
|
*
|
|
6223
|
-
* Use to transform both success and failure
|
|
6224
|
-
*
|
|
6261
|
+
* Use to transform both success and failure channels of an `Effect` without
|
|
6262
|
+
* changing whether it succeeds or fails.
|
|
6225
6263
|
*
|
|
6226
6264
|
* **Details**
|
|
6227
6265
|
*
|
|
@@ -6267,8 +6305,8 @@ export const mapBoth: {
|
|
|
6267
6305
|
*
|
|
6268
6306
|
* **When to use**
|
|
6269
6307
|
*
|
|
6270
|
-
* Use when
|
|
6271
|
-
*
|
|
6308
|
+
* Use when you need to turn an `Effect` typed failure that represents an
|
|
6309
|
+
* unrecoverable bug or invalid state into a defect.
|
|
6272
6310
|
*
|
|
6273
6311
|
* **Example** (Converting typed failures into defects)
|
|
6274
6312
|
*
|
|
@@ -6533,6 +6571,11 @@ export const tapErrorTag: {
|
|
|
6533
6571
|
* Runs an effectful operation with the full `Cause` when the source effect
|
|
6534
6572
|
* fails.
|
|
6535
6573
|
*
|
|
6574
|
+
* **When to use**
|
|
6575
|
+
*
|
|
6576
|
+
* Use when failure observation needs typed failures, defects, and interruptions
|
|
6577
|
+
* rather than only the typed error value.
|
|
6578
|
+
*
|
|
6536
6579
|
* **Details**
|
|
6537
6580
|
*
|
|
6538
6581
|
* Use this to log or inspect typed failures, defects, and interruptions. When
|
|
@@ -6564,6 +6607,11 @@ export const tapCause: {
|
|
|
6564
6607
|
* Runs an effectful operation with the full `Cause` when the source effect
|
|
6565
6608
|
* fails.
|
|
6566
6609
|
*
|
|
6610
|
+
* **When to use**
|
|
6611
|
+
*
|
|
6612
|
+
* Use when failure observation needs typed failures, defects, and interruptions
|
|
6613
|
+
* rather than only the typed error value.
|
|
6614
|
+
*
|
|
6567
6615
|
* **Details**
|
|
6568
6616
|
*
|
|
6569
6617
|
* Use this to log or inspect typed failures, defects, and interruptions. When
|
|
@@ -6595,6 +6643,11 @@ export const tapCause: {
|
|
|
6595
6643
|
* Runs an effectful operation with the full `Cause` when the source effect
|
|
6596
6644
|
* fails.
|
|
6597
6645
|
*
|
|
6646
|
+
* **When to use**
|
|
6647
|
+
*
|
|
6648
|
+
* Use when failure observation needs typed failures, defects, and interruptions
|
|
6649
|
+
* rather than only the typed error value.
|
|
6650
|
+
*
|
|
6598
6651
|
* **Details**
|
|
6599
6652
|
*
|
|
6600
6653
|
* Use this to log or inspect typed failures, defects, and interruptions. When
|
|
@@ -6734,8 +6787,9 @@ export const tapCauseIf: {
|
|
|
6734
6787
|
*
|
|
6735
6788
|
* **When to use**
|
|
6736
6789
|
*
|
|
6737
|
-
* Use when you need to observe only failure causes selected by a `Filter`,
|
|
6738
|
-
* the side effect
|
|
6790
|
+
* Use when you need to observe only failure causes selected by a `Filter`,
|
|
6791
|
+
* while giving the side effect both the selected value and the original
|
|
6792
|
+
* `Cause`.
|
|
6739
6793
|
*
|
|
6740
6794
|
* **Details**
|
|
6741
6795
|
*
|
|
@@ -6756,8 +6810,9 @@ export const tapCauseFilter: {
|
|
|
6756
6810
|
*
|
|
6757
6811
|
* **When to use**
|
|
6758
6812
|
*
|
|
6759
|
-
* Use when you need to observe only failure causes selected by a `Filter`,
|
|
6760
|
-
* the side effect
|
|
6813
|
+
* Use when you need to observe only failure causes selected by a `Filter`,
|
|
6814
|
+
* while giving the side effect both the selected value and the original
|
|
6815
|
+
* `Cause`.
|
|
6761
6816
|
*
|
|
6762
6817
|
* **Details**
|
|
6763
6818
|
*
|
|
@@ -6781,8 +6836,9 @@ export const tapCauseFilter: {
|
|
|
6781
6836
|
*
|
|
6782
6837
|
* **When to use**
|
|
6783
6838
|
*
|
|
6784
|
-
* Use when you need to observe only failure causes selected by a `Filter`,
|
|
6785
|
-
* the side effect
|
|
6839
|
+
* Use when you need to observe only failure causes selected by a `Filter`,
|
|
6840
|
+
* while giving the side effect both the selected value and the original
|
|
6841
|
+
* `Cause`.
|
|
6786
6842
|
*
|
|
6787
6843
|
* **Details**
|
|
6788
6844
|
*
|
|
@@ -6983,7 +7039,7 @@ export const tapDefect: {
|
|
|
6983
7039
|
* // Ready
|
|
6984
7040
|
* ```
|
|
6985
7041
|
*
|
|
6986
|
-
* @category repetition
|
|
7042
|
+
* @category repetition
|
|
6987
7043
|
* @since 2.0.0
|
|
6988
7044
|
*/
|
|
6989
7045
|
export const eventually: <A, E, R>(self: Effect<A, E, R>) => Effect<A, never, R> = internal.eventually
|
|
@@ -7046,8 +7102,8 @@ export declare namespace Retry {
|
|
|
7046
7102
|
*
|
|
7047
7103
|
* **When to use**
|
|
7048
7104
|
*
|
|
7049
|
-
* Use when
|
|
7050
|
-
* temporary resource unavailability.
|
|
7105
|
+
* Use when you need to rerun an effect after transient typed failures, such as
|
|
7106
|
+
* network issues or temporary resource unavailability.
|
|
7051
7107
|
*
|
|
7052
7108
|
* **Details**
|
|
7053
7109
|
*
|
|
@@ -7099,8 +7155,8 @@ export const retry: {
|
|
|
7099
7155
|
*
|
|
7100
7156
|
* **When to use**
|
|
7101
7157
|
*
|
|
7102
|
-
* Use when
|
|
7103
|
-
* temporary resource unavailability.
|
|
7158
|
+
* Use when you need to rerun an effect after transient typed failures, such as
|
|
7159
|
+
* network issues or temporary resource unavailability.
|
|
7104
7160
|
*
|
|
7105
7161
|
* **Details**
|
|
7106
7162
|
*
|
|
@@ -7152,8 +7208,8 @@ export const retry: {
|
|
|
7152
7208
|
*
|
|
7153
7209
|
* **When to use**
|
|
7154
7210
|
*
|
|
7155
|
-
* Use when
|
|
7156
|
-
* temporary resource unavailability.
|
|
7211
|
+
* Use when you need to rerun an effect after transient typed failures, such as
|
|
7212
|
+
* network issues or temporary resource unavailability.
|
|
7157
7213
|
*
|
|
7158
7214
|
* **Details**
|
|
7159
7215
|
*
|
|
@@ -7205,8 +7261,8 @@ export const retry: {
|
|
|
7205
7261
|
*
|
|
7206
7262
|
* **When to use**
|
|
7207
7263
|
*
|
|
7208
|
-
* Use when
|
|
7209
|
-
* temporary resource unavailability.
|
|
7264
|
+
* Use when you need to rerun an effect after transient typed failures, such as
|
|
7265
|
+
* network issues or temporary resource unavailability.
|
|
7210
7266
|
*
|
|
7211
7267
|
* **Details**
|
|
7212
7268
|
*
|
|
@@ -7262,8 +7318,8 @@ export const retry: {
|
|
|
7262
7318
|
*
|
|
7263
7319
|
* **When to use**
|
|
7264
7320
|
*
|
|
7265
|
-
* Use when
|
|
7266
|
-
* temporary resource unavailability.
|
|
7321
|
+
* Use when you need to rerun an effect after transient typed failures, such as
|
|
7322
|
+
* network issues or temporary resource unavailability.
|
|
7267
7323
|
*
|
|
7268
7324
|
* **Details**
|
|
7269
7325
|
*
|
|
@@ -7315,8 +7371,8 @@ export const retry: {
|
|
|
7315
7371
|
*
|
|
7316
7372
|
* **When to use**
|
|
7317
7373
|
*
|
|
7318
|
-
* Use when
|
|
7319
|
-
* temporary resource unavailability.
|
|
7374
|
+
* Use when you need to rerun an effect after transient typed failures, such as
|
|
7375
|
+
* network issues or temporary resource unavailability.
|
|
7320
7376
|
*
|
|
7321
7377
|
* **Details**
|
|
7322
7378
|
*
|
|
@@ -7368,8 +7424,8 @@ export const retry: {
|
|
|
7368
7424
|
*
|
|
7369
7425
|
* **When to use**
|
|
7370
7426
|
*
|
|
7371
|
-
* Use when
|
|
7372
|
-
* temporary resource unavailability.
|
|
7427
|
+
* Use when you need to rerun an effect after transient typed failures, such as
|
|
7428
|
+
* network issues or temporary resource unavailability.
|
|
7373
7429
|
*
|
|
7374
7430
|
* **Details**
|
|
7375
7431
|
*
|
|
@@ -7644,6 +7700,8 @@ export const sandbox: <A, E, R>(
|
|
|
7644
7700
|
* Use when an effect should run for its side effects while both success and
|
|
7645
7701
|
* failure values are discarded.
|
|
7646
7702
|
*
|
|
7703
|
+
* **Details**
|
|
7704
|
+
*
|
|
7647
7705
|
* Use the `log` option to emit the full {@link Cause} when the effect fails,
|
|
7648
7706
|
* and `message` to prepend a custom log message.
|
|
7649
7707
|
*
|
|
@@ -7695,6 +7753,11 @@ export const ignore: <
|
|
|
7695
7753
|
/**
|
|
7696
7754
|
* Ignores the effect's failure cause, including defects and interruptions.
|
|
7697
7755
|
*
|
|
7756
|
+
* **When to use**
|
|
7757
|
+
*
|
|
7758
|
+
* Use when a best-effort effect should never fail, even from defects or
|
|
7759
|
+
* interruption, and optional cause logging is enough.
|
|
7760
|
+
*
|
|
7698
7761
|
* **Details**
|
|
7699
7762
|
*
|
|
7700
7763
|
* Use the `log` option to emit the full {@link Cause} when the effect fails,
|
|
@@ -8003,9 +8066,9 @@ export const orElseSucceed: {
|
|
|
8003
8066
|
*
|
|
8004
8067
|
* **When to use**
|
|
8005
8068
|
*
|
|
8006
|
-
* Use when you have prioritized fallback
|
|
8007
|
-
*
|
|
8008
|
-
*
|
|
8069
|
+
* Use when you have prioritized fallback `Effect`s, such as attempting
|
|
8070
|
+
* multiple APIs, reading configuration from several sources, or trying
|
|
8071
|
+
* alternative resource locations in order.
|
|
8009
8072
|
*
|
|
8010
8073
|
* **Details**
|
|
8011
8074
|
*
|
|
@@ -8055,9 +8118,8 @@ export const firstSuccessOf: <Eff extends Effect<any, any, any>>(
|
|
|
8055
8118
|
*
|
|
8056
8119
|
* **When to use**
|
|
8057
8120
|
*
|
|
8058
|
-
* Use when
|
|
8059
|
-
* failure.
|
|
8060
|
-
* `timeoutOrElse` when you want to run a fallback effect.
|
|
8121
|
+
* Use when you need a timeout of an `Effect` to be represented as a typed
|
|
8122
|
+
* failure.
|
|
8061
8123
|
*
|
|
8062
8124
|
* **Details**
|
|
8063
8125
|
*
|
|
@@ -8118,9 +8180,8 @@ export const timeout: {
|
|
|
8118
8180
|
*
|
|
8119
8181
|
* **When to use**
|
|
8120
8182
|
*
|
|
8121
|
-
* Use when
|
|
8122
|
-
* failure.
|
|
8123
|
-
* `timeoutOrElse` when you want to run a fallback effect.
|
|
8183
|
+
* Use when you need a timeout of an `Effect` to be represented as a typed
|
|
8184
|
+
* failure.
|
|
8124
8185
|
*
|
|
8125
8186
|
* **Details**
|
|
8126
8187
|
*
|
|
@@ -8181,9 +8242,8 @@ export const timeout: {
|
|
|
8181
8242
|
*
|
|
8182
8243
|
* **When to use**
|
|
8183
8244
|
*
|
|
8184
|
-
* Use when
|
|
8185
|
-
* failure.
|
|
8186
|
-
* `timeoutOrElse` when you want to run a fallback effect.
|
|
8245
|
+
* Use when you need a timeout of an `Effect` to be represented as a typed
|
|
8246
|
+
* failure.
|
|
8187
8247
|
*
|
|
8188
8248
|
* **Details**
|
|
8189
8249
|
*
|
|
@@ -8242,9 +8302,7 @@ export const timeout: {
|
|
|
8242
8302
|
*
|
|
8243
8303
|
* **When to use**
|
|
8244
8304
|
*
|
|
8245
|
-
* Use when a timeout should be handled as
|
|
8246
|
-
* `timeout` when a timeout should fail the effect, and `timeoutOrElse` when
|
|
8247
|
-
* you want to run a fallback effect.
|
|
8305
|
+
* Use when a timeout of an `Effect` should be handled as `Option.none`.
|
|
8248
8306
|
*
|
|
8249
8307
|
* **Details**
|
|
8250
8308
|
*
|
|
@@ -8294,9 +8352,7 @@ export const timeoutOption: {
|
|
|
8294
8352
|
*
|
|
8295
8353
|
* **When to use**
|
|
8296
8354
|
*
|
|
8297
|
-
* Use when a timeout should be handled as
|
|
8298
|
-
* `timeout` when a timeout should fail the effect, and `timeoutOrElse` when
|
|
8299
|
-
* you want to run a fallback effect.
|
|
8355
|
+
* Use when a timeout of an `Effect` should be handled as `Option.none`.
|
|
8300
8356
|
*
|
|
8301
8357
|
* **Details**
|
|
8302
8358
|
*
|
|
@@ -8346,9 +8402,7 @@ export const timeoutOption: {
|
|
|
8346
8402
|
*
|
|
8347
8403
|
* **When to use**
|
|
8348
8404
|
*
|
|
8349
|
-
* Use when a timeout should be handled as
|
|
8350
|
-
* `timeout` when a timeout should fail the effect, and `timeoutOrElse` when
|
|
8351
|
-
* you want to run a fallback effect.
|
|
8405
|
+
* Use when a timeout of an `Effect` should be handled as `Option.none`.
|
|
8352
8406
|
*
|
|
8353
8407
|
* **Details**
|
|
8354
8408
|
*
|
|
@@ -8399,9 +8453,7 @@ export const timeoutOption: {
|
|
|
8399
8453
|
*
|
|
8400
8454
|
* **When to use**
|
|
8401
8455
|
*
|
|
8402
|
-
* Use when a timeout should switch to a fallback effect.
|
|
8403
|
-
* `timeout` when a timeout should fail the effect, and `timeoutOption` when a
|
|
8404
|
-
* timeout should become `Option.none`.
|
|
8456
|
+
* Use when a timeout of an `Effect` should switch to a fallback effect.
|
|
8405
8457
|
*
|
|
8406
8458
|
* **Details**
|
|
8407
8459
|
*
|
|
@@ -8453,9 +8505,7 @@ export const timeoutOrElse: {
|
|
|
8453
8505
|
*
|
|
8454
8506
|
* **When to use**
|
|
8455
8507
|
*
|
|
8456
|
-
* Use when a timeout should switch to a fallback effect.
|
|
8457
|
-
* `timeout` when a timeout should fail the effect, and `timeoutOption` when a
|
|
8458
|
-
* timeout should become `Option.none`.
|
|
8508
|
+
* Use when a timeout of an `Effect` should switch to a fallback effect.
|
|
8459
8509
|
*
|
|
8460
8510
|
* **Details**
|
|
8461
8511
|
*
|
|
@@ -8512,9 +8562,7 @@ export const timeoutOrElse: {
|
|
|
8512
8562
|
*
|
|
8513
8563
|
* **When to use**
|
|
8514
8564
|
*
|
|
8515
|
-
* Use when a timeout should switch to a fallback effect.
|
|
8516
|
-
* `timeout` when a timeout should fail the effect, and `timeoutOption` when a
|
|
8517
|
-
* timeout should become `Option.none`.
|
|
8565
|
+
* Use when a timeout of an `Effect` should switch to a fallback effect.
|
|
8518
8566
|
*
|
|
8519
8567
|
* **Details**
|
|
8520
8568
|
*
|
|
@@ -8885,6 +8933,11 @@ export const race: {
|
|
|
8885
8933
|
* Races two effects and returns the result of the first one to complete, whether
|
|
8886
8934
|
* it succeeds or fails.
|
|
8887
8935
|
*
|
|
8936
|
+
* **When to use**
|
|
8937
|
+
*
|
|
8938
|
+
* Use when any completion, including failure, should decide the race and
|
|
8939
|
+
* interrupt the losing effect.
|
|
8940
|
+
*
|
|
8888
8941
|
* **Details**
|
|
8889
8942
|
*
|
|
8890
8943
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
@@ -8917,6 +8970,11 @@ export const raceFirst: {
|
|
|
8917
8970
|
* Races two effects and returns the result of the first one to complete, whether
|
|
8918
8971
|
* it succeeds or fails.
|
|
8919
8972
|
*
|
|
8973
|
+
* **When to use**
|
|
8974
|
+
*
|
|
8975
|
+
* Use when any completion, including failure, should decide the race and
|
|
8976
|
+
* interrupt the losing effect.
|
|
8977
|
+
*
|
|
8920
8978
|
* **Details**
|
|
8921
8979
|
*
|
|
8922
8980
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
@@ -8956,6 +9014,11 @@ export const raceFirst: {
|
|
|
8956
9014
|
* Races two effects and returns the result of the first one to complete, whether
|
|
8957
9015
|
* it succeeds or fails.
|
|
8958
9016
|
*
|
|
9017
|
+
* **When to use**
|
|
9018
|
+
*
|
|
9019
|
+
* Use when any completion, including failure, should decide the race and
|
|
9020
|
+
* interrupt the losing effect.
|
|
9021
|
+
*
|
|
8959
9022
|
* **Details**
|
|
8960
9023
|
*
|
|
8961
9024
|
* The losing effect is interrupted, and `onWinner` can observe the winning fiber.
|
|
@@ -9190,8 +9253,8 @@ export const filter: {
|
|
|
9190
9253
|
*
|
|
9191
9254
|
* **When to use**
|
|
9192
9255
|
*
|
|
9193
|
-
* Use to
|
|
9194
|
-
* filter success value.
|
|
9256
|
+
* Use when you need to filter an iterable with a `Filter` inside an `Effect`,
|
|
9257
|
+
* collecting each filter success value.
|
|
9195
9258
|
*
|
|
9196
9259
|
* **Details**
|
|
9197
9260
|
*
|
|
@@ -9210,8 +9273,8 @@ export const filterMap: {
|
|
|
9210
9273
|
*
|
|
9211
9274
|
* **When to use**
|
|
9212
9275
|
*
|
|
9213
|
-
* Use to
|
|
9214
|
-
* filter success value.
|
|
9276
|
+
* Use when you need to filter an iterable with a `Filter` inside an `Effect`,
|
|
9277
|
+
* collecting each filter success value.
|
|
9215
9278
|
*
|
|
9216
9279
|
* **Details**
|
|
9217
9280
|
*
|
|
@@ -9230,8 +9293,8 @@ export const filterMap: {
|
|
|
9230
9293
|
*
|
|
9231
9294
|
* **When to use**
|
|
9232
9295
|
*
|
|
9233
|
-
* Use to
|
|
9234
|
-
* filter success value.
|
|
9296
|
+
* Use when you need to filter an iterable with a `Filter` inside an `Effect`,
|
|
9297
|
+
* collecting each filter success value.
|
|
9235
9298
|
*
|
|
9236
9299
|
* **Details**
|
|
9237
9300
|
*
|
|
@@ -9252,8 +9315,8 @@ export const filterMap: {
|
|
|
9252
9315
|
*
|
|
9253
9316
|
* **When to use**
|
|
9254
9317
|
*
|
|
9255
|
-
* Use when
|
|
9256
|
-
* elements
|
|
9318
|
+
* Use when you need to filter each iterable element effectfully and transform
|
|
9319
|
+
* accepted elements into successful output values.
|
|
9257
9320
|
*
|
|
9258
9321
|
* **Details**
|
|
9259
9322
|
*
|
|
@@ -9277,8 +9340,8 @@ export const filterMapEffect: {
|
|
|
9277
9340
|
*
|
|
9278
9341
|
* **When to use**
|
|
9279
9342
|
*
|
|
9280
|
-
* Use when
|
|
9281
|
-
* elements
|
|
9343
|
+
* Use when you need to filter each iterable element effectfully and transform
|
|
9344
|
+
* accepted elements into successful output values.
|
|
9282
9345
|
*
|
|
9283
9346
|
* **Details**
|
|
9284
9347
|
*
|
|
@@ -9305,8 +9368,8 @@ export const filterMapEffect: {
|
|
|
9305
9368
|
*
|
|
9306
9369
|
* **When to use**
|
|
9307
9370
|
*
|
|
9308
|
-
* Use when
|
|
9309
|
-
* elements
|
|
9371
|
+
* Use when you need to filter each iterable element effectfully and transform
|
|
9372
|
+
* accepted elements into successful output values.
|
|
9310
9373
|
*
|
|
9311
9374
|
* **Details**
|
|
9312
9375
|
*
|
|
@@ -9334,6 +9397,11 @@ export const filterMapEffect: {
|
|
|
9334
9397
|
/**
|
|
9335
9398
|
* Filters an effect, providing an alternative effect if the predicate fails.
|
|
9336
9399
|
*
|
|
9400
|
+
* **When to use**
|
|
9401
|
+
*
|
|
9402
|
+
* Use when a successful value that fails a predicate should continue with an
|
|
9403
|
+
* effectful fallback instead of failing the effect.
|
|
9404
|
+
*
|
|
9337
9405
|
* **Details**
|
|
9338
9406
|
*
|
|
9339
9407
|
* This function applies a predicate to the result of an effect. If the
|
|
@@ -9366,6 +9434,11 @@ export const filterOrElse: {
|
|
|
9366
9434
|
/**
|
|
9367
9435
|
* Filters an effect, providing an alternative effect if the predicate fails.
|
|
9368
9436
|
*
|
|
9437
|
+
* **When to use**
|
|
9438
|
+
*
|
|
9439
|
+
* Use when a successful value that fails a predicate should continue with an
|
|
9440
|
+
* effectful fallback instead of failing the effect.
|
|
9441
|
+
*
|
|
9369
9442
|
* **Details**
|
|
9370
9443
|
*
|
|
9371
9444
|
* This function applies a predicate to the result of an effect. If the
|
|
@@ -9401,6 +9474,11 @@ export const filterOrElse: {
|
|
|
9401
9474
|
/**
|
|
9402
9475
|
* Filters an effect, providing an alternative effect if the predicate fails.
|
|
9403
9476
|
*
|
|
9477
|
+
* **When to use**
|
|
9478
|
+
*
|
|
9479
|
+
* Use when a successful value that fails a predicate should continue with an
|
|
9480
|
+
* effectful fallback instead of failing the effect.
|
|
9481
|
+
*
|
|
9404
9482
|
* **Details**
|
|
9405
9483
|
*
|
|
9406
9484
|
* This function applies a predicate to the result of an effect. If the
|
|
@@ -9436,6 +9514,11 @@ export const filterOrElse: {
|
|
|
9436
9514
|
/**
|
|
9437
9515
|
* Filters an effect, providing an alternative effect if the predicate fails.
|
|
9438
9516
|
*
|
|
9517
|
+
* **When to use**
|
|
9518
|
+
*
|
|
9519
|
+
* Use when a successful value that fails a predicate should continue with an
|
|
9520
|
+
* effectful fallback instead of failing the effect.
|
|
9521
|
+
*
|
|
9439
9522
|
* **Details**
|
|
9440
9523
|
*
|
|
9441
9524
|
* This function applies a predicate to the result of an effect. If the
|
|
@@ -9472,6 +9555,11 @@ export const filterOrElse: {
|
|
|
9472
9555
|
/**
|
|
9473
9556
|
* Filters an effect, providing an alternative effect if the predicate fails.
|
|
9474
9557
|
*
|
|
9558
|
+
* **When to use**
|
|
9559
|
+
*
|
|
9560
|
+
* Use when a successful value that fails a predicate should continue with an
|
|
9561
|
+
* effectful fallback instead of failing the effect.
|
|
9562
|
+
*
|
|
9475
9563
|
* **Details**
|
|
9476
9564
|
*
|
|
9477
9565
|
* This function applies a predicate to the result of an effect. If the
|
|
@@ -9995,8 +10083,8 @@ export const filterMapOrFail: {
|
|
|
9995
10083
|
*
|
|
9996
10084
|
* **When to use**
|
|
9997
10085
|
*
|
|
9998
|
-
* Use when an effectful check
|
|
9999
|
-
* representing the skipped case explicitly.
|
|
10086
|
+
* Use when you need an effectful check to decide whether another effect should
|
|
10087
|
+
* run while representing the skipped case explicitly.
|
|
10000
10088
|
*
|
|
10001
10089
|
* **Details**
|
|
10002
10090
|
*
|
|
@@ -10036,8 +10124,8 @@ export const when: {
|
|
|
10036
10124
|
*
|
|
10037
10125
|
* **When to use**
|
|
10038
10126
|
*
|
|
10039
|
-
* Use when an effectful check
|
|
10040
|
-
* representing the skipped case explicitly.
|
|
10127
|
+
* Use when you need an effectful check to decide whether another effect should
|
|
10128
|
+
* run while representing the skipped case explicitly.
|
|
10041
10129
|
*
|
|
10042
10130
|
* **Details**
|
|
10043
10131
|
*
|
|
@@ -10077,8 +10165,8 @@ export const when: {
|
|
|
10077
10165
|
*
|
|
10078
10166
|
* **When to use**
|
|
10079
10167
|
*
|
|
10080
|
-
* Use when an effectful check
|
|
10081
|
-
* representing the skipped case explicitly.
|
|
10168
|
+
* Use when you need an effectful check to decide whether another effect should
|
|
10169
|
+
* run while representing the skipped case explicitly.
|
|
10082
10170
|
*
|
|
10083
10171
|
* **Details**
|
|
10084
10172
|
*
|
|
@@ -10120,8 +10208,8 @@ export const when: {
|
|
|
10120
10208
|
*
|
|
10121
10209
|
* **When to use**
|
|
10122
10210
|
*
|
|
10123
|
-
* Use when
|
|
10124
|
-
* failure without triggering side effects.
|
|
10211
|
+
* Use when you need to fold an `Effect` into a value by handling success and
|
|
10212
|
+
* failure differently without triggering side effects.
|
|
10125
10213
|
*
|
|
10126
10214
|
* **Details**
|
|
10127
10215
|
*
|
|
@@ -10177,8 +10265,8 @@ export const match: {
|
|
|
10177
10265
|
*
|
|
10178
10266
|
* **When to use**
|
|
10179
10267
|
*
|
|
10180
|
-
* Use when
|
|
10181
|
-
* failure without triggering side effects.
|
|
10268
|
+
* Use when you need to fold an `Effect` into a value by handling success and
|
|
10269
|
+
* failure differently without triggering side effects.
|
|
10182
10270
|
*
|
|
10183
10271
|
* **Details**
|
|
10184
10272
|
*
|
|
@@ -10239,8 +10327,8 @@ export const match: {
|
|
|
10239
10327
|
*
|
|
10240
10328
|
* **When to use**
|
|
10241
10329
|
*
|
|
10242
|
-
* Use when
|
|
10243
|
-
* failure without triggering side effects.
|
|
10330
|
+
* Use when you need to fold an `Effect` into a value by handling success and
|
|
10331
|
+
* failure differently without triggering side effects.
|
|
10244
10332
|
*
|
|
10245
10333
|
* **Details**
|
|
10246
10334
|
*
|
|
@@ -10300,9 +10388,8 @@ export const match: {
|
|
|
10300
10388
|
*
|
|
10301
10389
|
* **When to use**
|
|
10302
10390
|
*
|
|
10303
|
-
* Use when you need to handle both success and failure cases
|
|
10304
|
-
*
|
|
10305
|
-
* scenarios where you frequently work with already computed values.
|
|
10391
|
+
* Use when you need to handle both success and failure cases of an
|
|
10392
|
+
* already-resolved `Effect` with optimized handling.
|
|
10306
10393
|
*
|
|
10307
10394
|
* **Details**
|
|
10308
10395
|
*
|
|
@@ -10337,9 +10424,8 @@ export const matchEager: {
|
|
|
10337
10424
|
*
|
|
10338
10425
|
* **When to use**
|
|
10339
10426
|
*
|
|
10340
|
-
* Use when you need to handle both success and failure cases
|
|
10341
|
-
*
|
|
10342
|
-
* scenarios where you frequently work with already computed values.
|
|
10427
|
+
* Use when you need to handle both success and failure cases of an
|
|
10428
|
+
* already-resolved `Effect` with optimized handling.
|
|
10343
10429
|
*
|
|
10344
10430
|
* **Details**
|
|
10345
10431
|
*
|
|
@@ -10379,9 +10465,8 @@ export const matchEager: {
|
|
|
10379
10465
|
*
|
|
10380
10466
|
* **When to use**
|
|
10381
10467
|
*
|
|
10382
|
-
* Use when you need to handle both success and failure cases
|
|
10383
|
-
*
|
|
10384
|
-
* scenarios where you frequently work with already computed values.
|
|
10468
|
+
* Use when you need to handle both success and failure cases of an
|
|
10469
|
+
* already-resolved `Effect` with optimized handling.
|
|
10385
10470
|
*
|
|
10386
10471
|
* **Details**
|
|
10387
10472
|
*
|
|
@@ -10423,9 +10508,8 @@ export const matchEager: {
|
|
|
10423
10508
|
*
|
|
10424
10509
|
* **When to use**
|
|
10425
10510
|
*
|
|
10426
|
-
* Use when
|
|
10427
|
-
*
|
|
10428
|
-
* handling logic for each failure type based on the cause.
|
|
10511
|
+
* Use when you need to fold an `Effect` while the failure handler inspects the
|
|
10512
|
+
* full `Cause`.
|
|
10429
10513
|
*
|
|
10430
10514
|
* **Details**
|
|
10431
10515
|
*
|
|
@@ -10460,9 +10544,8 @@ export const matchCause: {
|
|
|
10460
10544
|
*
|
|
10461
10545
|
* **When to use**
|
|
10462
10546
|
*
|
|
10463
|
-
* Use when
|
|
10464
|
-
*
|
|
10465
|
-
* handling logic for each failure type based on the cause.
|
|
10547
|
+
* Use when you need to fold an `Effect` while the failure handler inspects the
|
|
10548
|
+
* full `Cause`.
|
|
10466
10549
|
*
|
|
10467
10550
|
* **Details**
|
|
10468
10551
|
*
|
|
@@ -10502,9 +10585,8 @@ export const matchCause: {
|
|
|
10502
10585
|
*
|
|
10503
10586
|
* **When to use**
|
|
10504
10587
|
*
|
|
10505
|
-
* Use when
|
|
10506
|
-
*
|
|
10507
|
-
* handling logic for each failure type based on the cause.
|
|
10588
|
+
* Use when you need to fold an `Effect` while the failure handler inspects the
|
|
10589
|
+
* full `Cause`.
|
|
10508
10590
|
*
|
|
10509
10591
|
* **Details**
|
|
10510
10592
|
*
|
|
@@ -10547,9 +10629,8 @@ export const matchCause: {
|
|
|
10547
10629
|
*
|
|
10548
10630
|
* **When to use**
|
|
10549
10631
|
*
|
|
10550
|
-
* Use when
|
|
10551
|
-
*
|
|
10552
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
10632
|
+
* Use when you expect an `Effect` to already be resolved and want to match the
|
|
10633
|
+
* `Cause` without regular effect pipeline overhead.
|
|
10553
10634
|
*
|
|
10554
10635
|
* **Details**
|
|
10555
10636
|
*
|
|
@@ -10577,9 +10658,8 @@ export const matchCauseEager: {
|
|
|
10577
10658
|
*
|
|
10578
10659
|
* **When to use**
|
|
10579
10660
|
*
|
|
10580
|
-
* Use when
|
|
10581
|
-
*
|
|
10582
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
10661
|
+
* Use when you expect an `Effect` to already be resolved and want to match the
|
|
10662
|
+
* `Cause` without regular effect pipeline overhead.
|
|
10583
10663
|
*
|
|
10584
10664
|
* **Details**
|
|
10585
10665
|
*
|
|
@@ -10612,9 +10692,8 @@ export const matchCauseEager: {
|
|
|
10612
10692
|
*
|
|
10613
10693
|
* **When to use**
|
|
10614
10694
|
*
|
|
10615
|
-
* Use when
|
|
10616
|
-
*
|
|
10617
|
-
* it automatically falls back to the regular `matchCause` behavior.
|
|
10695
|
+
* Use when you expect an `Effect` to already be resolved and want to match the
|
|
10696
|
+
* `Cause` without regular effect pipeline overhead.
|
|
10618
10697
|
*
|
|
10619
10698
|
* **Details**
|
|
10620
10699
|
*
|
|
@@ -10650,9 +10729,8 @@ export const matchCauseEager: {
|
|
|
10650
10729
|
*
|
|
10651
10730
|
* **When to use**
|
|
10652
10731
|
*
|
|
10653
|
-
* Use when success and cause-aware failure handlers
|
|
10654
|
-
*
|
|
10655
|
-
* while unresolved inputs keep normal effectful matching behavior.
|
|
10732
|
+
* Use when you need effectful success and cause-aware failure handlers for
|
|
10733
|
+
* `Effect` inputs that may already be resolved.
|
|
10656
10734
|
*
|
|
10657
10735
|
* **Details**
|
|
10658
10736
|
*
|
|
@@ -10672,9 +10750,8 @@ export const matchCauseEffectEager: {
|
|
|
10672
10750
|
*
|
|
10673
10751
|
* **When to use**
|
|
10674
10752
|
*
|
|
10675
|
-
* Use when success and cause-aware failure handlers
|
|
10676
|
-
*
|
|
10677
|
-
* while unresolved inputs keep normal effectful matching behavior.
|
|
10753
|
+
* Use when you need effectful success and cause-aware failure handlers for
|
|
10754
|
+
* `Effect` inputs that may already be resolved.
|
|
10678
10755
|
*
|
|
10679
10756
|
* **Details**
|
|
10680
10757
|
*
|
|
@@ -10699,9 +10776,8 @@ export const matchCauseEffectEager: {
|
|
|
10699
10776
|
*
|
|
10700
10777
|
* **When to use**
|
|
10701
10778
|
*
|
|
10702
|
-
* Use when success and cause-aware failure handlers
|
|
10703
|
-
*
|
|
10704
|
-
* while unresolved inputs keep normal effectful matching behavior.
|
|
10779
|
+
* Use when you need effectful success and cause-aware failure handlers for
|
|
10780
|
+
* `Effect` inputs that may already be resolved.
|
|
10705
10781
|
*
|
|
10706
10782
|
* **Details**
|
|
10707
10783
|
*
|
|
@@ -10729,8 +10805,8 @@ export const matchCauseEffectEager: {
|
|
|
10729
10805
|
*
|
|
10730
10806
|
* **When to use**
|
|
10731
10807
|
*
|
|
10732
|
-
* Use when
|
|
10733
|
-
* failure
|
|
10808
|
+
* Use when you need to fold an `Effect` with effectful success handlers and
|
|
10809
|
+
* `Cause`-aware failure handlers.
|
|
10734
10810
|
*
|
|
10735
10811
|
* **Details**
|
|
10736
10812
|
*
|
|
@@ -10789,8 +10865,8 @@ export const matchCauseEffect: {
|
|
|
10789
10865
|
*
|
|
10790
10866
|
* **When to use**
|
|
10791
10867
|
*
|
|
10792
|
-
* Use when
|
|
10793
|
-
* failure
|
|
10868
|
+
* Use when you need to fold an `Effect` with effectful success handlers and
|
|
10869
|
+
* `Cause`-aware failure handlers.
|
|
10794
10870
|
*
|
|
10795
10871
|
* **Details**
|
|
10796
10872
|
*
|
|
@@ -10854,8 +10930,8 @@ export const matchCauseEffect: {
|
|
|
10854
10930
|
*
|
|
10855
10931
|
* **When to use**
|
|
10856
10932
|
*
|
|
10857
|
-
* Use when
|
|
10858
|
-
* failure
|
|
10933
|
+
* Use when you need to fold an `Effect` with effectful success handlers and
|
|
10934
|
+
* `Cause`-aware failure handlers.
|
|
10859
10935
|
*
|
|
10860
10936
|
* **Details**
|
|
10861
10937
|
*
|
|
@@ -10922,7 +10998,8 @@ export const matchCauseEffect: {
|
|
|
10922
10998
|
*
|
|
10923
10999
|
* **When to use**
|
|
10924
11000
|
*
|
|
10925
|
-
* Use when
|
|
11001
|
+
* Use when you need to handle an `Effect`'s failure or success with handlers
|
|
11002
|
+
* that return effects.
|
|
10926
11003
|
*
|
|
10927
11004
|
* **Details**
|
|
10928
11005
|
*
|
|
@@ -10982,7 +11059,8 @@ export const matchEffect: {
|
|
|
10982
11059
|
*
|
|
10983
11060
|
* **When to use**
|
|
10984
11061
|
*
|
|
10985
|
-
* Use when
|
|
11062
|
+
* Use when you need to handle an `Effect`'s failure or success with handlers
|
|
11063
|
+
* that return effects.
|
|
10986
11064
|
*
|
|
10987
11065
|
* **Details**
|
|
10988
11066
|
*
|
|
@@ -11047,7 +11125,8 @@ export const matchEffect: {
|
|
|
11047
11125
|
*
|
|
11048
11126
|
* **When to use**
|
|
11049
11127
|
*
|
|
11050
|
-
* Use when
|
|
11128
|
+
* Use when you need to handle an `Effect`'s failure or success with handlers
|
|
11129
|
+
* that return effects.
|
|
11051
11130
|
*
|
|
11052
11131
|
* **Details**
|
|
11053
11132
|
*
|
|
@@ -12303,6 +12382,11 @@ export const provideService: {
|
|
|
12303
12382
|
/**
|
|
12304
12383
|
* Provides one service to an effect using an effectful acquisition.
|
|
12305
12384
|
*
|
|
12385
|
+
* **When to use**
|
|
12386
|
+
*
|
|
12387
|
+
* Use when the service implementation must be created by an effect and its
|
|
12388
|
+
* acquisition failure should remain in the returned effect.
|
|
12389
|
+
*
|
|
12306
12390
|
* **Details**
|
|
12307
12391
|
*
|
|
12308
12392
|
* `provideServiceEffect` runs the acquisition effect to produce the service
|
|
@@ -12357,6 +12441,11 @@ export const provideServiceEffect: {
|
|
|
12357
12441
|
/**
|
|
12358
12442
|
* Provides one service to an effect using an effectful acquisition.
|
|
12359
12443
|
*
|
|
12444
|
+
* **When to use**
|
|
12445
|
+
*
|
|
12446
|
+
* Use when the service implementation must be created by an effect and its
|
|
12447
|
+
* acquisition failure should remain in the returned effect.
|
|
12448
|
+
*
|
|
12360
12449
|
* **Details**
|
|
12361
12450
|
*
|
|
12362
12451
|
* `provideServiceEffect` runs the acquisition effect to produce the service
|
|
@@ -12411,6 +12500,11 @@ export const provideServiceEffect: {
|
|
|
12411
12500
|
/**
|
|
12412
12501
|
* Provides one service to an effect using an effectful acquisition.
|
|
12413
12502
|
*
|
|
12503
|
+
* **When to use**
|
|
12504
|
+
*
|
|
12505
|
+
* Use when the service implementation must be created by an effect and its
|
|
12506
|
+
* acquisition failure should remain in the returned effect.
|
|
12507
|
+
*
|
|
12414
12508
|
* **Details**
|
|
12415
12509
|
*
|
|
12416
12510
|
* `provideServiceEffect` runs the acquisition effect to produce the service
|
|
@@ -12665,6 +12759,11 @@ export const scoped: <A, E, R>(
|
|
|
12665
12759
|
/**
|
|
12666
12760
|
* Creates a scoped effect by providing access to the scope.
|
|
12667
12761
|
*
|
|
12762
|
+
* **When to use**
|
|
12763
|
+
*
|
|
12764
|
+
* Use when resource acquisition needs direct access to the scope being created,
|
|
12765
|
+
* for example to register finalizers manually.
|
|
12766
|
+
*
|
|
12668
12767
|
* **Example** (Working with an explicit scope)
|
|
12669
12768
|
*
|
|
12670
12769
|
* ```ts
|
|
@@ -12777,8 +12876,8 @@ export const acquireRelease: <A, E, R, R2>(
|
|
|
12777
12876
|
*
|
|
12778
12877
|
* **When to use**
|
|
12779
12878
|
*
|
|
12780
|
-
* Use with JavaScript `Disposable` or `AsyncDisposable` resources
|
|
12781
|
-
* be closed with the surrounding scope.
|
|
12879
|
+
* Use when you work with JavaScript `Disposable` or `AsyncDisposable` resources
|
|
12880
|
+
* that should be closed with the surrounding scope.
|
|
12782
12881
|
*
|
|
12783
12882
|
* **Details**
|
|
12784
12883
|
*
|
|
@@ -13595,10 +13694,8 @@ export const onExitFilter: {
|
|
|
13595
13694
|
*
|
|
13596
13695
|
* **When to use**
|
|
13597
13696
|
*
|
|
13598
|
-
* Use when you
|
|
13599
|
-
*
|
|
13600
|
-
* and all following evaluations will immediately return the cached value,
|
|
13601
|
-
* improving performance and reducing unnecessary work.
|
|
13697
|
+
* Use when you need an expensive or time-consuming operation to be evaluated
|
|
13698
|
+
* once and reused by later callers.
|
|
13602
13699
|
*
|
|
13603
13700
|
* **Details**
|
|
13604
13701
|
*
|
|
@@ -13660,14 +13757,8 @@ export const cached: <A, E, R>(self: Effect<A, E, R>) => Effect<Effect<A, E, R>>
|
|
|
13660
13757
|
*
|
|
13661
13758
|
* **When to use**
|
|
13662
13759
|
*
|
|
13663
|
-
* Use when you
|
|
13664
|
-
*
|
|
13665
|
-
*
|
|
13666
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
13667
|
-
* frequently and can be reused for a specified duration.
|
|
13668
|
-
*
|
|
13669
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
13670
|
-
* computations, especially in performance-critical applications.
|
|
13760
|
+
* Use when you need a costly effect result to be reused for a bounded duration
|
|
13761
|
+
* before being recomputed.
|
|
13671
13762
|
*
|
|
13672
13763
|
* **Details**
|
|
13673
13764
|
*
|
|
@@ -13727,14 +13818,8 @@ export const cachedWithTTL: {
|
|
|
13727
13818
|
*
|
|
13728
13819
|
* **When to use**
|
|
13729
13820
|
*
|
|
13730
|
-
* Use when you
|
|
13731
|
-
*
|
|
13732
|
-
*
|
|
13733
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
13734
|
-
* frequently and can be reused for a specified duration.
|
|
13735
|
-
*
|
|
13736
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
13737
|
-
* computations, especially in performance-critical applications.
|
|
13821
|
+
* Use when you need a costly effect result to be reused for a bounded duration
|
|
13822
|
+
* before being recomputed.
|
|
13738
13823
|
*
|
|
13739
13824
|
* **Details**
|
|
13740
13825
|
*
|
|
@@ -13794,14 +13879,8 @@ export const cachedWithTTL: {
|
|
|
13794
13879
|
*
|
|
13795
13880
|
* **When to use**
|
|
13796
13881
|
*
|
|
13797
|
-
* Use when you
|
|
13798
|
-
*
|
|
13799
|
-
*
|
|
13800
|
-
* It's ideal for scenarios where the result of an effect doesn't change
|
|
13801
|
-
* frequently and can be reused for a specified duration.
|
|
13802
|
-
*
|
|
13803
|
-
* By caching the result, you can improve efficiency and reduce unnecessary
|
|
13804
|
-
* computations, especially in performance-critical applications.
|
|
13882
|
+
* Use when you need a costly effect result to be reused for a bounded duration
|
|
13883
|
+
* before being recomputed.
|
|
13805
13884
|
*
|
|
13806
13885
|
* **Details**
|
|
13807
13886
|
*
|
|
@@ -14326,7 +14405,7 @@ export declare namespace Repeat {
|
|
|
14326
14405
|
/**
|
|
14327
14406
|
* Computes the result type of `Effect.repeat` from the original effect and repeat options.
|
|
14328
14407
|
*
|
|
14329
|
-
* @category repetition
|
|
14408
|
+
* @category repetition
|
|
14330
14409
|
* @since 2.0.0
|
|
14331
14410
|
*/
|
|
14332
14411
|
export type Return<R, E, A, O extends Options<A>> = Effect<
|
|
@@ -14357,7 +14436,7 @@ export declare namespace Repeat {
|
|
|
14357
14436
|
/**
|
|
14358
14437
|
* Options that control whether and how an effect is repeated.
|
|
14359
14438
|
*
|
|
14360
|
-
* @category repetition
|
|
14439
|
+
* @category repetition
|
|
14361
14440
|
* @since 2.0.0
|
|
14362
14441
|
*/
|
|
14363
14442
|
export interface Options<A> {
|
|
@@ -14395,7 +14474,7 @@ export declare namespace Repeat {
|
|
|
14395
14474
|
* })
|
|
14396
14475
|
* ```
|
|
14397
14476
|
*
|
|
14398
|
-
* @category repetition
|
|
14477
|
+
* @category repetition
|
|
14399
14478
|
* @since 2.0.0
|
|
14400
14479
|
*/
|
|
14401
14480
|
export const forever: <
|
|
@@ -14485,7 +14564,7 @@ export const forever: <
|
|
|
14485
14564
|
* @see {@link retry} for failure-based repetition
|
|
14486
14565
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14487
14566
|
*
|
|
14488
|
-
* @category repetition
|
|
14567
|
+
* @category repetition
|
|
14489
14568
|
* @since 2.0.0
|
|
14490
14569
|
*/
|
|
14491
14570
|
export const repeat: {
|
|
@@ -14562,7 +14641,7 @@ export const repeat: {
|
|
|
14562
14641
|
* @see {@link retry} for failure-based repetition
|
|
14563
14642
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14564
14643
|
*
|
|
14565
|
-
* @category repetition
|
|
14644
|
+
* @category repetition
|
|
14566
14645
|
* @since 2.0.0
|
|
14567
14646
|
*/
|
|
14568
14647
|
<O extends Repeat.Options<A>, A>(options: O): <E, R>(self: Effect<A, E, R>) => Repeat.Return<R, E, A, O>
|
|
@@ -14639,7 +14718,7 @@ export const repeat: {
|
|
|
14639
14718
|
* @see {@link retry} for failure-based repetition
|
|
14640
14719
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14641
14720
|
*
|
|
14642
|
-
* @category repetition
|
|
14721
|
+
* @category repetition
|
|
14643
14722
|
* @since 2.0.0
|
|
14644
14723
|
*/
|
|
14645
14724
|
<Output, Input, Error, Env>(schedule: Schedule<Output, NoInfer<Input>, Error, Env>): <E, R>(self: Effect<Input, E, R>) => Effect<Output, E | Error, R | Env>
|
|
@@ -14716,7 +14795,7 @@ export const repeat: {
|
|
|
14716
14795
|
* @see {@link retry} for failure-based repetition
|
|
14717
14796
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14718
14797
|
*
|
|
14719
|
-
* @category repetition
|
|
14798
|
+
* @category repetition
|
|
14720
14799
|
* @since 2.0.0
|
|
14721
14800
|
*/
|
|
14722
14801
|
<Output, Input, Error, Env>(
|
|
@@ -14797,7 +14876,7 @@ export const repeat: {
|
|
|
14797
14876
|
* @see {@link retry} for failure-based repetition
|
|
14798
14877
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14799
14878
|
*
|
|
14800
|
-
* @category repetition
|
|
14879
|
+
* @category repetition
|
|
14801
14880
|
* @since 2.0.0
|
|
14802
14881
|
*/
|
|
14803
14882
|
<A, E, R, O extends Repeat.Options<A>>(self: Effect<A, E, R>, options: O): Repeat.Return<R, E, A, O>
|
|
@@ -14874,7 +14953,7 @@ export const repeat: {
|
|
|
14874
14953
|
* @see {@link retry} for failure-based repetition
|
|
14875
14954
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14876
14955
|
*
|
|
14877
|
-
* @category repetition
|
|
14956
|
+
* @category repetition
|
|
14878
14957
|
* @since 2.0.0
|
|
14879
14958
|
*/
|
|
14880
14959
|
<Input, E, R, Output, Error, Env>(
|
|
@@ -14954,7 +15033,7 @@ export const repeat: {
|
|
|
14954
15033
|
* @see {@link retry} for failure-based repetition
|
|
14955
15034
|
* @see {@link repeatOrElse} for fallback handling when repetition fails
|
|
14956
15035
|
*
|
|
14957
|
-
* @category repetition
|
|
15036
|
+
* @category repetition
|
|
14958
15037
|
* @since 2.0.0
|
|
14959
15038
|
*/
|
|
14960
15039
|
<Input, E, R, Output, Error, Env>(
|
|
@@ -14969,6 +15048,11 @@ export const repeat: {
|
|
|
14969
15048
|
* Repeats an effect according to a schedule and runs a fallback effect if
|
|
14970
15049
|
* repetition fails before the schedule completes.
|
|
14971
15050
|
*
|
|
15051
|
+
* **When to use**
|
|
15052
|
+
*
|
|
15053
|
+
* Use when successful repetitions should follow a schedule, but failures from
|
|
15054
|
+
* the repeated effect or schedule need an effectful fallback.
|
|
15055
|
+
*
|
|
14972
15056
|
* **Details**
|
|
14973
15057
|
*
|
|
14974
15058
|
* If the repeated effect or schedule step fails, `orElse` receives the failure
|
|
@@ -15004,7 +15088,7 @@ export const repeat: {
|
|
|
15004
15088
|
* )
|
|
15005
15089
|
* ```
|
|
15006
15090
|
*
|
|
15007
|
-
* @category repetition
|
|
15091
|
+
* @category repetition
|
|
15008
15092
|
* @since 2.0.0
|
|
15009
15093
|
*/
|
|
15010
15094
|
export const repeatOrElse: {
|
|
@@ -15012,6 +15096,11 @@ export const repeatOrElse: {
|
|
|
15012
15096
|
* Repeats an effect according to a schedule and runs a fallback effect if
|
|
15013
15097
|
* repetition fails before the schedule completes.
|
|
15014
15098
|
*
|
|
15099
|
+
* **When to use**
|
|
15100
|
+
*
|
|
15101
|
+
* Use when successful repetitions should follow a schedule, but failures from
|
|
15102
|
+
* the repeated effect or schedule need an effectful fallback.
|
|
15103
|
+
*
|
|
15015
15104
|
* **Details**
|
|
15016
15105
|
*
|
|
15017
15106
|
* If the repeated effect or schedule step fails, `orElse` receives the failure
|
|
@@ -15047,7 +15136,7 @@ export const repeatOrElse: {
|
|
|
15047
15136
|
* )
|
|
15048
15137
|
* ```
|
|
15049
15138
|
*
|
|
15050
|
-
* @category repetition
|
|
15139
|
+
* @category repetition
|
|
15051
15140
|
* @since 2.0.0
|
|
15052
15141
|
*/
|
|
15053
15142
|
<R2, A, B, E, E2, E3, R3>(
|
|
@@ -15058,6 +15147,11 @@ export const repeatOrElse: {
|
|
|
15058
15147
|
* Repeats an effect according to a schedule and runs a fallback effect if
|
|
15059
15148
|
* repetition fails before the schedule completes.
|
|
15060
15149
|
*
|
|
15150
|
+
* **When to use**
|
|
15151
|
+
*
|
|
15152
|
+
* Use when successful repetitions should follow a schedule, but failures from
|
|
15153
|
+
* the repeated effect or schedule need an effectful fallback.
|
|
15154
|
+
*
|
|
15061
15155
|
* **Details**
|
|
15062
15156
|
*
|
|
15063
15157
|
* If the repeated effect or schedule step fails, `orElse` receives the failure
|
|
@@ -15093,7 +15187,7 @@ export const repeatOrElse: {
|
|
|
15093
15187
|
* )
|
|
15094
15188
|
* ```
|
|
15095
15189
|
*
|
|
15096
|
-
* @category repetition
|
|
15190
|
+
* @category repetition
|
|
15097
15191
|
* @since 2.0.0
|
|
15098
15192
|
*/
|
|
15099
15193
|
<A, E, R, R2, B, E2, E3, R3>(
|
|
@@ -15108,9 +15202,8 @@ export const repeatOrElse: {
|
|
|
15108
15202
|
*
|
|
15109
15203
|
* **When to use**
|
|
15110
15204
|
*
|
|
15111
|
-
* Use
|
|
15112
|
-
*
|
|
15113
|
-
* separately.
|
|
15205
|
+
* Use when you need an array of identical effect values without running them
|
|
15206
|
+
* yet.
|
|
15114
15207
|
*
|
|
15115
15208
|
* **Details**
|
|
15116
15209
|
*
|
|
@@ -15128,9 +15221,8 @@ export const replicate: {
|
|
|
15128
15221
|
*
|
|
15129
15222
|
* **When to use**
|
|
15130
15223
|
*
|
|
15131
|
-
* Use
|
|
15132
|
-
*
|
|
15133
|
-
* separately.
|
|
15224
|
+
* Use when you need an array of identical effect values without running them
|
|
15225
|
+
* yet.
|
|
15134
15226
|
*
|
|
15135
15227
|
* **Details**
|
|
15136
15228
|
*
|
|
@@ -15148,9 +15240,8 @@ export const replicate: {
|
|
|
15148
15240
|
*
|
|
15149
15241
|
* **When to use**
|
|
15150
15242
|
*
|
|
15151
|
-
* Use
|
|
15152
|
-
*
|
|
15153
|
-
* separately.
|
|
15243
|
+
* Use when you need an array of identical effect values without running them
|
|
15244
|
+
* yet.
|
|
15154
15245
|
*
|
|
15155
15246
|
* **Details**
|
|
15156
15247
|
*
|
|
@@ -15168,6 +15259,11 @@ export const replicate: {
|
|
|
15168
15259
|
/**
|
|
15169
15260
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
15170
15261
|
*
|
|
15262
|
+
* **When to use**
|
|
15263
|
+
*
|
|
15264
|
+
* Use when you want to run the repeated effects immediately, with optional
|
|
15265
|
+
* concurrency control or result discarding.
|
|
15266
|
+
*
|
|
15171
15267
|
* **Details**
|
|
15172
15268
|
*
|
|
15173
15269
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
@@ -15190,6 +15286,11 @@ export const replicateEffect: {
|
|
|
15190
15286
|
/**
|
|
15191
15287
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
15192
15288
|
*
|
|
15289
|
+
* **When to use**
|
|
15290
|
+
*
|
|
15291
|
+
* Use when you want to run the repeated effects immediately, with optional
|
|
15292
|
+
* concurrency control or result discarding.
|
|
15293
|
+
*
|
|
15193
15294
|
* **Details**
|
|
15194
15295
|
*
|
|
15195
15296
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
@@ -15215,6 +15316,11 @@ export const replicateEffect: {
|
|
|
15215
15316
|
/**
|
|
15216
15317
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
15217
15318
|
*
|
|
15319
|
+
* **When to use**
|
|
15320
|
+
*
|
|
15321
|
+
* Use when you want to run the repeated effects immediately, with optional
|
|
15322
|
+
* concurrency control or result discarding.
|
|
15323
|
+
*
|
|
15218
15324
|
* **Details**
|
|
15219
15325
|
*
|
|
15220
15326
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
@@ -15240,6 +15346,11 @@ export const replicateEffect: {
|
|
|
15240
15346
|
/**
|
|
15241
15347
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
15242
15348
|
*
|
|
15349
|
+
* **When to use**
|
|
15350
|
+
*
|
|
15351
|
+
* Use when you want to run the repeated effects immediately, with optional
|
|
15352
|
+
* concurrency control or result discarding.
|
|
15353
|
+
*
|
|
15243
15354
|
* **Details**
|
|
15244
15355
|
*
|
|
15245
15356
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
@@ -15266,6 +15377,11 @@ export const replicateEffect: {
|
|
|
15266
15377
|
/**
|
|
15267
15378
|
* Performs this effect `n` times and collects results with `Effect.all` semantics.
|
|
15268
15379
|
*
|
|
15380
|
+
* **When to use**
|
|
15381
|
+
*
|
|
15382
|
+
* Use when you want to run the repeated effects immediately, with optional
|
|
15383
|
+
* concurrency control or result discarding.
|
|
15384
|
+
*
|
|
15269
15385
|
* **Details**
|
|
15270
15386
|
*
|
|
15271
15387
|
* Use `concurrency` to control parallelism and `discard: true` to ignore results.
|
|
@@ -15335,7 +15451,7 @@ export const replicateEffect: {
|
|
|
15335
15451
|
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
15336
15452
|
* to depend on the result of this effect.
|
|
15337
15453
|
*
|
|
15338
|
-
* @category repetition
|
|
15454
|
+
* @category repetition
|
|
15339
15455
|
* @since 2.0.0
|
|
15340
15456
|
*/
|
|
15341
15457
|
export const schedule: {
|
|
@@ -15383,7 +15499,7 @@ export const schedule: {
|
|
|
15383
15499
|
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
15384
15500
|
* to depend on the result of this effect.
|
|
15385
15501
|
*
|
|
15386
|
-
* @category repetition
|
|
15502
|
+
* @category repetition
|
|
15387
15503
|
* @since 2.0.0
|
|
15388
15504
|
*/
|
|
15389
15505
|
<Output, Error, Env>(schedule: Schedule<Output, unknown, Error, Env>): <A, E, R>(self: Effect<A, E, R>) => Effect<Output, E, R | Env>
|
|
@@ -15431,7 +15547,7 @@ export const schedule: {
|
|
|
15431
15547
|
* @see {@link scheduleFrom} for a variant that allows the schedule's decision
|
|
15432
15548
|
* to depend on the result of this effect.
|
|
15433
15549
|
*
|
|
15434
|
-
* @category repetition
|
|
15550
|
+
* @category repetition
|
|
15435
15551
|
* @since 2.0.0
|
|
15436
15552
|
*/
|
|
15437
15553
|
<A, E, R, Output, Error, Env>(self: Effect<A, E, R>, schedule: Schedule<Output, unknown, Error, Env>): Effect<Output, E, R | Env>
|
|
@@ -15474,7 +15590,7 @@ export const schedule: {
|
|
|
15474
15590
|
* // Returns the schedule count
|
|
15475
15591
|
* ```
|
|
15476
15592
|
*
|
|
15477
|
-
* @category repetition
|
|
15593
|
+
* @category repetition
|
|
15478
15594
|
* @since 2.0.0
|
|
15479
15595
|
*/
|
|
15480
15596
|
export const scheduleFrom: {
|
|
@@ -15512,7 +15628,7 @@ export const scheduleFrom: {
|
|
|
15512
15628
|
* // Returns the schedule count
|
|
15513
15629
|
* ```
|
|
15514
15630
|
*
|
|
15515
|
-
* @category repetition
|
|
15631
|
+
* @category repetition
|
|
15516
15632
|
* @since 2.0.0
|
|
15517
15633
|
*/
|
|
15518
15634
|
<Input, Output, Error, Env>(initial: Input, schedule: Schedule<Output, Input, Error, Env>): <E, R>(self: Effect<Input, E, R>) => Effect<Output, E, R | Env>
|
|
@@ -15550,7 +15666,7 @@ export const scheduleFrom: {
|
|
|
15550
15666
|
* // Returns the schedule count
|
|
15551
15667
|
* ```
|
|
15552
15668
|
*
|
|
15553
|
-
* @category repetition
|
|
15669
|
+
* @category repetition
|
|
15554
15670
|
* @since 2.0.0
|
|
15555
15671
|
*/
|
|
15556
15672
|
<Input, E, R, Output, Error, Env>(
|
|
@@ -16668,9 +16784,7 @@ export const withParentSpan: {
|
|
|
16668
16784
|
*
|
|
16669
16785
|
* **When to use**
|
|
16670
16786
|
*
|
|
16671
|
-
* Use
|
|
16672
|
-
* concurrent requests made with the same resolver to be collected and completed
|
|
16673
|
-
* by resolver logic.
|
|
16787
|
+
* Use when you need resolver-driven batching for a typed `Request`.
|
|
16674
16788
|
*
|
|
16675
16789
|
* **Example** (Executing a request through a resolver)
|
|
16676
16790
|
*
|
|
@@ -16712,9 +16826,7 @@ export const request: {
|
|
|
16712
16826
|
*
|
|
16713
16827
|
* **When to use**
|
|
16714
16828
|
*
|
|
16715
|
-
* Use
|
|
16716
|
-
* concurrent requests made with the same resolver to be collected and completed
|
|
16717
|
-
* by resolver logic.
|
|
16829
|
+
* Use when you need resolver-driven batching for a typed `Request`.
|
|
16718
16830
|
*
|
|
16719
16831
|
* **Example** (Executing a request through a resolver)
|
|
16720
16832
|
*
|
|
@@ -16756,9 +16868,7 @@ export const request: {
|
|
|
16756
16868
|
*
|
|
16757
16869
|
* **When to use**
|
|
16758
16870
|
*
|
|
16759
|
-
* Use
|
|
16760
|
-
* concurrent requests made with the same resolver to be collected and completed
|
|
16761
|
-
* by resolver logic.
|
|
16871
|
+
* Use when you need resolver-driven batching for a typed `Request`.
|
|
16762
16872
|
*
|
|
16763
16873
|
* **Example** (Executing a request through a resolver)
|
|
16764
16874
|
*
|
|
@@ -17182,7 +17292,7 @@ export const fiberId: Effect<number> = internal.fiberId
|
|
|
17182
17292
|
* @see {@link runPromise} for promise-based running with these options
|
|
17183
17293
|
* @see {@link runPromiseExit} for promise-based running that returns an `Exit`
|
|
17184
17294
|
*
|
|
17185
|
-
* @category running
|
|
17295
|
+
* @category running
|
|
17186
17296
|
* @since 4.0.0
|
|
17187
17297
|
*/
|
|
17188
17298
|
export interface RunOptions {
|
|
@@ -17198,9 +17308,7 @@ export interface RunOptions {
|
|
|
17198
17308
|
*
|
|
17199
17309
|
* **When to use**
|
|
17200
17310
|
*
|
|
17201
|
-
* Use when
|
|
17202
|
-
* be observed or interrupted. Prefer this when you do not need a `Promise` or
|
|
17203
|
-
* synchronous result.
|
|
17311
|
+
* Use when you need to start an effect in the background and receive a fiber.
|
|
17204
17312
|
*
|
|
17205
17313
|
* **Example** (Running an effect in the background)
|
|
17206
17314
|
*
|
|
@@ -17223,7 +17331,7 @@ export interface RunOptions {
|
|
|
17223
17331
|
* }, 500)
|
|
17224
17332
|
* ```
|
|
17225
17333
|
*
|
|
17226
|
-
* @category running
|
|
17334
|
+
* @category running
|
|
17227
17335
|
* @since 2.0.0
|
|
17228
17336
|
*/
|
|
17229
17337
|
export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions | undefined) => Fiber<A, E> =
|
|
@@ -17232,6 +17340,11 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
|
|
|
17232
17340
|
/**
|
|
17233
17341
|
* Runs an effect in the background with the provided services.
|
|
17234
17342
|
*
|
|
17343
|
+
* **When to use**
|
|
17344
|
+
*
|
|
17345
|
+
* Use when an effect still requires services, you already have a `Context`, and
|
|
17346
|
+
* you want a background fiber.
|
|
17347
|
+
*
|
|
17235
17348
|
* **Example** (Running with services in the background)
|
|
17236
17349
|
*
|
|
17237
17350
|
* ```ts
|
|
@@ -17256,7 +17369,7 @@ export const runFork: <A, E>(effect: Effect<A, E, never>, options?: RunOptions |
|
|
|
17256
17369
|
* const fiber = Effect.runForkWith(services)(program)
|
|
17257
17370
|
* ```
|
|
17258
17371
|
*
|
|
17259
|
-
* @category running
|
|
17372
|
+
* @category running
|
|
17260
17373
|
* @since 4.0.0
|
|
17261
17374
|
*/
|
|
17262
17375
|
export const runForkWith: <R>(
|
|
@@ -17266,6 +17379,11 @@ export const runForkWith: <R>(
|
|
|
17266
17379
|
/**
|
|
17267
17380
|
* Forks an effect with the provided services, registers `onExit` as a fiber observer, and returns an interruptor.
|
|
17268
17381
|
*
|
|
17382
|
+
* **When to use**
|
|
17383
|
+
*
|
|
17384
|
+
* Use when embedding an effect into callback-style code with explicit services
|
|
17385
|
+
* and a synchronous interruptor.
|
|
17386
|
+
*
|
|
17269
17387
|
* **Details**
|
|
17270
17388
|
*
|
|
17271
17389
|
* The returned interruptor calls `fiber.interruptUnsafe`, optionally with an interruptor id.
|
|
@@ -17303,7 +17421,7 @@ export const runForkWith: <R>(
|
|
|
17303
17421
|
* interrupt()
|
|
17304
17422
|
* ```
|
|
17305
17423
|
*
|
|
17306
|
-
* @category running
|
|
17424
|
+
* @category running
|
|
17307
17425
|
* @since 4.0.0
|
|
17308
17426
|
*/
|
|
17309
17427
|
export const runCallbackWith: <R>(
|
|
@@ -17350,7 +17468,7 @@ export const runCallbackWith: <R>(
|
|
|
17350
17468
|
* // interrupt() to cancel the fiber if needed
|
|
17351
17469
|
* ```
|
|
17352
17470
|
*
|
|
17353
|
-
* @category running
|
|
17471
|
+
* @category running
|
|
17354
17472
|
* @since 2.0.0
|
|
17355
17473
|
*/
|
|
17356
17474
|
export const runCallback: <A, E>(
|
|
@@ -17391,7 +17509,7 @@ export const runCallback: <A, E>(
|
|
|
17391
17509
|
* ```
|
|
17392
17510
|
*
|
|
17393
17511
|
* @see {@link runPromiseExit} for a version that returns an `Exit` type instead of rejecting.
|
|
17394
|
-
* @category running
|
|
17512
|
+
* @category running
|
|
17395
17513
|
* @since 2.0.0
|
|
17396
17514
|
*/
|
|
17397
17515
|
export const runPromise: <A, E>(
|
|
@@ -17402,6 +17520,11 @@ export const runPromise: <A, E>(
|
|
|
17402
17520
|
/**
|
|
17403
17521
|
* Executes an effect as a Promise with the provided services.
|
|
17404
17522
|
*
|
|
17523
|
+
* **When to use**
|
|
17524
|
+
*
|
|
17525
|
+
* Use when you already have a `Context` and need Promise interop that rejects on
|
|
17526
|
+
* effect failure.
|
|
17527
|
+
*
|
|
17405
17528
|
* **Example** (Running with services as a promise)
|
|
17406
17529
|
*
|
|
17407
17530
|
* ```ts
|
|
@@ -17425,7 +17548,7 @@ export const runPromise: <A, E>(
|
|
|
17425
17548
|
* Effect.runPromiseWith(context)(program).then(console.log)
|
|
17426
17549
|
* ```
|
|
17427
17550
|
*
|
|
17428
|
-
* @category running
|
|
17551
|
+
* @category running
|
|
17429
17552
|
* @since 4.0.0
|
|
17430
17553
|
*/
|
|
17431
17554
|
export const runPromiseWith: <R>(
|
|
@@ -17443,10 +17566,9 @@ export const runPromiseWith: <R>(
|
|
|
17443
17566
|
*
|
|
17444
17567
|
* **Details**
|
|
17445
17568
|
*
|
|
17446
|
-
* The `Exit` type represents the result of the effect
|
|
17447
|
-
*
|
|
17448
|
-
*
|
|
17449
|
-
* a `Cause` type.
|
|
17569
|
+
* The `Exit` type represents the result of the effect. Successful effects are
|
|
17570
|
+
* wrapped in `Success`, and failed effects are wrapped in `Failure` with a
|
|
17571
|
+
* `Cause`.
|
|
17450
17572
|
*
|
|
17451
17573
|
* **Example** (Observing promise results as Exit)
|
|
17452
17574
|
*
|
|
@@ -17478,7 +17600,7 @@ export const runPromiseWith: <R>(
|
|
|
17478
17600
|
*
|
|
17479
17601
|
* @see {@link runPromise} for a version that rejects on failure.
|
|
17480
17602
|
*
|
|
17481
|
-
* @category running
|
|
17603
|
+
* @category running
|
|
17482
17604
|
* @since 2.0.0
|
|
17483
17605
|
*/
|
|
17484
17606
|
export const runPromiseExit: <A, E>(
|
|
@@ -17489,6 +17611,11 @@ export const runPromiseExit: <A, E>(
|
|
|
17489
17611
|
/**
|
|
17490
17612
|
* Runs an effect and returns a Promise of Exit with provided services.
|
|
17491
17613
|
*
|
|
17614
|
+
* **When to use**
|
|
17615
|
+
*
|
|
17616
|
+
* Use when you already have a `Context` and need Promise interop that preserves
|
|
17617
|
+
* success and failure as an `Exit`.
|
|
17618
|
+
*
|
|
17492
17619
|
* **Example** (Running with services as an Exit promise)
|
|
17493
17620
|
*
|
|
17494
17621
|
* ```ts
|
|
@@ -17516,7 +17643,7 @@ export const runPromiseExit: <A, E>(
|
|
|
17516
17643
|
* })
|
|
17517
17644
|
* ```
|
|
17518
17645
|
*
|
|
17519
|
-
* @category running
|
|
17646
|
+
* @category running
|
|
17520
17647
|
* @since 4.0.0
|
|
17521
17648
|
*/
|
|
17522
17649
|
export const runPromiseExitWith: <R>(
|
|
@@ -17581,7 +17708,7 @@ export const runPromiseExitWith: <R>(
|
|
|
17581
17708
|
*
|
|
17582
17709
|
* @see {@link runSyncExit} for a version that returns an `Exit` type instead of
|
|
17583
17710
|
* throwing an error.
|
|
17584
|
-
* @category running
|
|
17711
|
+
* @category running
|
|
17585
17712
|
* @since 2.0.0
|
|
17586
17713
|
*/
|
|
17587
17714
|
export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
|
|
@@ -17589,6 +17716,11 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
|
|
|
17589
17716
|
/**
|
|
17590
17717
|
* Executes an effect synchronously with provided services.
|
|
17591
17718
|
*
|
|
17719
|
+
* **When to use**
|
|
17720
|
+
*
|
|
17721
|
+
* Use when you already have a `Context`, the effect is known to complete
|
|
17722
|
+
* synchronously, and failures should throw.
|
|
17723
|
+
*
|
|
17592
17724
|
* **Example** (Running synchronously with services)
|
|
17593
17725
|
*
|
|
17594
17726
|
* ```ts
|
|
@@ -17613,7 +17745,7 @@ export const runSync: <A, E>(effect: Effect<A, E>) => A = internal.runSync
|
|
|
17613
17745
|
* console.log(result) // 5
|
|
17614
17746
|
* ```
|
|
17615
17747
|
*
|
|
17616
|
-
* @category running
|
|
17748
|
+
* @category running
|
|
17617
17749
|
* @since 4.0.0
|
|
17618
17750
|
*/
|
|
17619
17751
|
export const runSyncWith: <R>(
|
|
@@ -17631,10 +17763,9 @@ export const runSyncWith: <R>(
|
|
|
17631
17763
|
*
|
|
17632
17764
|
* **Details**
|
|
17633
17765
|
*
|
|
17634
|
-
* The `Exit` type represents the result of the effect
|
|
17635
|
-
*
|
|
17636
|
-
*
|
|
17637
|
-
* a `Cause` type.
|
|
17766
|
+
* The `Exit` type represents the result of the effect. Successful effects are
|
|
17767
|
+
* wrapped in `Success`, and failed effects are wrapped in `Failure` with a
|
|
17768
|
+
* `Cause`.
|
|
17638
17769
|
*
|
|
17639
17770
|
* If the effect contains asynchronous operations, `runSyncExit` will
|
|
17640
17771
|
* return an `Failure` with a `Die` cause, indicating that the effect cannot be
|
|
@@ -17690,7 +17821,7 @@ export const runSyncWith: <R>(
|
|
|
17690
17821
|
*
|
|
17691
17822
|
* @see {@link runSync} for a version that throws on failure.
|
|
17692
17823
|
*
|
|
17693
|
-
* @category running
|
|
17824
|
+
* @category running
|
|
17694
17825
|
* @since 2.0.0
|
|
17695
17826
|
*/
|
|
17696
17827
|
export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = internal.runSyncExit
|
|
@@ -17698,6 +17829,11 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
|
|
|
17698
17829
|
/**
|
|
17699
17830
|
* Runs an effect synchronously with provided services, returning an Exit result safely.
|
|
17700
17831
|
*
|
|
17832
|
+
* **When to use**
|
|
17833
|
+
*
|
|
17834
|
+
* Use when you already have a `Context` and need a synchronous `Exit` instead of
|
|
17835
|
+
* throwing on failure.
|
|
17836
|
+
*
|
|
17701
17837
|
* **Example** (Running synchronously with services as Exit)
|
|
17702
17838
|
*
|
|
17703
17839
|
* ```ts
|
|
@@ -17731,7 +17867,7 @@ export const runSyncExit: <A, E>(effect: Effect<A, E>) => Exit.Exit<A, E> = inte
|
|
|
17731
17867
|
* // Success: 42
|
|
17732
17868
|
* ```
|
|
17733
17869
|
*
|
|
17734
|
-
* @category running
|
|
17870
|
+
* @category running
|
|
17735
17871
|
* @since 4.0.0
|
|
17736
17872
|
*/
|
|
17737
17873
|
export const runSyncExitWith: <R>(
|
|
@@ -24015,13 +24151,10 @@ export class Transaction extends Context.Service<
|
|
|
24015
24151
|
* If called inside an active transaction, `tx` composes with the current transaction and reuses
|
|
24016
24152
|
* its journal and retry state instead of creating a nested boundary.
|
|
24017
24153
|
*
|
|
24018
|
-
*
|
|
24019
|
-
*
|
|
24020
|
-
*
|
|
24021
|
-
*
|
|
24022
|
-
*
|
|
24023
|
-
* - any of the accessed transactional values change during the execution of the transaction
|
|
24024
|
-
* due to a different transaction committing before the current.
|
|
24154
|
+
* Effect transactions are optimistic with retry. A transaction is retried when
|
|
24155
|
+
* its body explicitly calls `Effect.txRetry` and any accessed transactional
|
|
24156
|
+
* value changes, or when any accessed transactional value changes because a
|
|
24157
|
+
* different transaction commits before the current one.
|
|
24025
24158
|
*
|
|
24026
24159
|
* The outermost `tx` call creates the transaction boundary and commits or rolls back the full
|
|
24027
24160
|
* composed transaction.
|
|
@@ -24351,7 +24484,7 @@ export declare namespace Effectify {
|
|
|
24351
24484
|
/**
|
|
24352
24485
|
* Extracts the callback error type from a callback-based function type.
|
|
24353
24486
|
*
|
|
24354
|
-
* @category
|
|
24487
|
+
* @category effectify
|
|
24355
24488
|
* @since 4.0.0
|
|
24356
24489
|
*/
|
|
24357
24490
|
export type EffectifyError<T> = T extends {
|
|
@@ -24758,11 +24891,8 @@ export const satisfiesServicesType = <R>() => <A, E, R2 extends R>(effect: Effec
|
|
|
24758
24891
|
*
|
|
24759
24892
|
* **Details**
|
|
24760
24893
|
*
|
|
24761
|
-
*
|
|
24762
|
-
*
|
|
24763
|
-
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
24764
|
-
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
24765
|
-
* - For **Pending effects**: Falls back to the regular `map` behavior
|
|
24894
|
+
* Success effects apply the mapping function immediately. Failure effects pass
|
|
24895
|
+
* through unchanged, and pending effects fall back to regular `map` behavior.
|
|
24766
24896
|
*
|
|
24767
24897
|
* **Example** (Mapping already completed effects)
|
|
24768
24898
|
*
|
|
@@ -24792,11 +24922,8 @@ export const mapEager: {
|
|
|
24792
24922
|
*
|
|
24793
24923
|
* **Details**
|
|
24794
24924
|
*
|
|
24795
|
-
*
|
|
24796
|
-
*
|
|
24797
|
-
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
24798
|
-
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
24799
|
-
* - For **Pending effects**: Falls back to the regular `map` behavior
|
|
24925
|
+
* Success effects apply the mapping function immediately. Failure effects pass
|
|
24926
|
+
* through unchanged, and pending effects fall back to regular `map` behavior.
|
|
24800
24927
|
*
|
|
24801
24928
|
* **Example** (Mapping already completed effects)
|
|
24802
24929
|
*
|
|
@@ -24826,11 +24953,8 @@ export const mapEager: {
|
|
|
24826
24953
|
*
|
|
24827
24954
|
* **Details**
|
|
24828
24955
|
*
|
|
24829
|
-
*
|
|
24830
|
-
*
|
|
24831
|
-
* - For **Success effects**: Applies the mapping function immediately to the value
|
|
24832
|
-
* - For **Failure effects**: Returns the failure as-is without applying the mapping
|
|
24833
|
-
* - For **Pending effects**: Falls back to the regular `map` behavior
|
|
24956
|
+
* Success effects apply the mapping function immediately. Failure effects pass
|
|
24957
|
+
* through unchanged, and pending effects fall back to regular `map` behavior.
|
|
24834
24958
|
*
|
|
24835
24959
|
* **Example** (Mapping already completed effects)
|
|
24836
24960
|
*
|
|
@@ -24863,11 +24987,9 @@ export const mapEager: {
|
|
|
24863
24987
|
*
|
|
24864
24988
|
* **Details**
|
|
24865
24989
|
*
|
|
24866
|
-
*
|
|
24867
|
-
*
|
|
24868
|
-
*
|
|
24869
|
-
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
24870
|
-
* - For **Pending effects**: Falls back to the regular `mapError` behavior
|
|
24990
|
+
* Success effects pass through unchanged because there is no error to
|
|
24991
|
+
* transform. Failure effects apply the mapping function immediately, and
|
|
24992
|
+
* pending effects fall back to regular `mapError` behavior.
|
|
24871
24993
|
*
|
|
24872
24994
|
* **Example** (Mapping errors eagerly when possible)
|
|
24873
24995
|
*
|
|
@@ -24901,11 +25023,9 @@ export const mapErrorEager: {
|
|
|
24901
25023
|
*
|
|
24902
25024
|
* **Details**
|
|
24903
25025
|
*
|
|
24904
|
-
*
|
|
24905
|
-
*
|
|
24906
|
-
*
|
|
24907
|
-
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
24908
|
-
* - For **Pending effects**: Falls back to the regular `mapError` behavior
|
|
25026
|
+
* Success effects pass through unchanged because there is no error to
|
|
25027
|
+
* transform. Failure effects apply the mapping function immediately, and
|
|
25028
|
+
* pending effects fall back to regular `mapError` behavior.
|
|
24909
25029
|
*
|
|
24910
25030
|
* **Example** (Mapping errors eagerly when possible)
|
|
24911
25031
|
*
|
|
@@ -24939,11 +25059,9 @@ export const mapErrorEager: {
|
|
|
24939
25059
|
*
|
|
24940
25060
|
* **Details**
|
|
24941
25061
|
*
|
|
24942
|
-
*
|
|
24943
|
-
*
|
|
24944
|
-
*
|
|
24945
|
-
* - For **Failure effects**: Applies the mapping function immediately to the error
|
|
24946
|
-
* - For **Pending effects**: Falls back to the regular `mapError` behavior
|
|
25062
|
+
* Success effects pass through unchanged because there is no error to
|
|
25063
|
+
* transform. Failure effects apply the mapping function immediately, and
|
|
25064
|
+
* pending effects fall back to regular `mapError` behavior.
|
|
24947
25065
|
*
|
|
24948
25066
|
* **Example** (Mapping errors eagerly when possible)
|
|
24949
25067
|
*
|
|
@@ -24978,11 +25096,9 @@ export const mapErrorEager: {
|
|
|
24978
25096
|
*
|
|
24979
25097
|
* **Details**
|
|
24980
25098
|
*
|
|
24981
|
-
*
|
|
24982
|
-
*
|
|
24983
|
-
*
|
|
24984
|
-
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
24985
|
-
* - For **Pending effects**: Falls back to the regular `mapBoth` behavior
|
|
25099
|
+
* Success effects apply `onSuccess` immediately, and failure effects apply
|
|
25100
|
+
* `onFailure` immediately. Pending effects fall back to regular `mapBoth`
|
|
25101
|
+
* behavior.
|
|
24986
25102
|
*
|
|
24987
25103
|
* **Example** (Mapping both channels eagerly when possible)
|
|
24988
25104
|
*
|
|
@@ -25017,11 +25133,9 @@ export const mapBothEager: {
|
|
|
25017
25133
|
*
|
|
25018
25134
|
* **Details**
|
|
25019
25135
|
*
|
|
25020
|
-
*
|
|
25021
|
-
*
|
|
25022
|
-
*
|
|
25023
|
-
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
25024
|
-
* - For **Pending effects**: Falls back to the regular `mapBoth` behavior
|
|
25136
|
+
* Success effects apply `onSuccess` immediately, and failure effects apply
|
|
25137
|
+
* `onFailure` immediately. Pending effects fall back to regular `mapBoth`
|
|
25138
|
+
* behavior.
|
|
25025
25139
|
*
|
|
25026
25140
|
* **Example** (Mapping both channels eagerly when possible)
|
|
25027
25141
|
*
|
|
@@ -25058,11 +25172,9 @@ export const mapBothEager: {
|
|
|
25058
25172
|
*
|
|
25059
25173
|
* **Details**
|
|
25060
25174
|
*
|
|
25061
|
-
*
|
|
25062
|
-
*
|
|
25063
|
-
*
|
|
25064
|
-
* - For **Failure effects**: Applies the `onFailure` function immediately to the error
|
|
25065
|
-
* - For **Pending effects**: Falls back to the regular `mapBoth` behavior
|
|
25175
|
+
* Success effects apply `onSuccess` immediately, and failure effects apply
|
|
25176
|
+
* `onFailure` immediately. Pending effects fall back to regular `mapBoth`
|
|
25177
|
+
* behavior.
|
|
25066
25178
|
*
|
|
25067
25179
|
* **Example** (Mapping both channels eagerly when possible)
|
|
25068
25180
|
*
|
|
@@ -25102,11 +25214,9 @@ export const mapBothEager: {
|
|
|
25102
25214
|
*
|
|
25103
25215
|
* **Details**
|
|
25104
25216
|
*
|
|
25105
|
-
*
|
|
25106
|
-
*
|
|
25107
|
-
*
|
|
25108
|
-
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
25109
|
-
* - For **Pending effects**: Falls back to the regular `flatMap` behavior
|
|
25217
|
+
* Success effects apply the flatMap function immediately. Failure effects pass
|
|
25218
|
+
* through unchanged, and pending effects fall back to regular `flatMap`
|
|
25219
|
+
* behavior.
|
|
25110
25220
|
*
|
|
25111
25221
|
* **Example** (Flat mapping eagerly when possible)
|
|
25112
25222
|
*
|
|
@@ -25139,11 +25249,9 @@ export const flatMapEager: {
|
|
|
25139
25249
|
*
|
|
25140
25250
|
* **Details**
|
|
25141
25251
|
*
|
|
25142
|
-
*
|
|
25143
|
-
*
|
|
25144
|
-
*
|
|
25145
|
-
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
25146
|
-
* - For **Pending effects**: Falls back to the regular `flatMap` behavior
|
|
25252
|
+
* Success effects apply the flatMap function immediately. Failure effects pass
|
|
25253
|
+
* through unchanged, and pending effects fall back to regular `flatMap`
|
|
25254
|
+
* behavior.
|
|
25147
25255
|
*
|
|
25148
25256
|
* **Example** (Flat mapping eagerly when possible)
|
|
25149
25257
|
*
|
|
@@ -25176,11 +25284,9 @@ export const flatMapEager: {
|
|
|
25176
25284
|
*
|
|
25177
25285
|
* **Details**
|
|
25178
25286
|
*
|
|
25179
|
-
*
|
|
25180
|
-
*
|
|
25181
|
-
*
|
|
25182
|
-
* - For **Failure effects**: Returns the failure as-is without applying the flatMap
|
|
25183
|
-
* - For **Pending effects**: Falls back to the regular `flatMap` behavior
|
|
25287
|
+
* Success effects apply the flatMap function immediately. Failure effects pass
|
|
25288
|
+
* through unchanged, and pending effects fall back to regular `flatMap`
|
|
25289
|
+
* behavior.
|
|
25184
25290
|
*
|
|
25185
25291
|
* **Example** (Flat mapping eagerly when possible)
|
|
25186
25292
|
*
|
|
@@ -25215,11 +25321,9 @@ export const flatMapEager: {
|
|
|
25215
25321
|
*
|
|
25216
25322
|
* **Details**
|
|
25217
25323
|
*
|
|
25218
|
-
*
|
|
25219
|
-
*
|
|
25220
|
-
*
|
|
25221
|
-
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
25222
|
-
* - For **Pending effects**: Falls back to the regular `catch` behavior
|
|
25324
|
+
* Success effects pass through unchanged because there is no error to catch.
|
|
25325
|
+
* Failure effects apply the catch function immediately, and pending effects
|
|
25326
|
+
* fall back to regular `catch` behavior.
|
|
25223
25327
|
*
|
|
25224
25328
|
* **Example** (Catching failures eagerly when possible)
|
|
25225
25329
|
*
|
|
@@ -25262,11 +25366,9 @@ export const catchEager: {
|
|
|
25262
25366
|
*
|
|
25263
25367
|
* **Details**
|
|
25264
25368
|
*
|
|
25265
|
-
*
|
|
25266
|
-
*
|
|
25267
|
-
*
|
|
25268
|
-
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
25269
|
-
* - For **Pending effects**: Falls back to the regular `catch` behavior
|
|
25369
|
+
* Success effects pass through unchanged because there is no error to catch.
|
|
25370
|
+
* Failure effects apply the catch function immediately, and pending effects
|
|
25371
|
+
* fall back to regular `catch` behavior.
|
|
25270
25372
|
*
|
|
25271
25373
|
* **Example** (Catching failures eagerly when possible)
|
|
25272
25374
|
*
|
|
@@ -25309,11 +25411,9 @@ export const catchEager: {
|
|
|
25309
25411
|
*
|
|
25310
25412
|
* **Details**
|
|
25311
25413
|
*
|
|
25312
|
-
*
|
|
25313
|
-
*
|
|
25314
|
-
*
|
|
25315
|
-
* - For **Failure effects**: Applies the catch function immediately to the error
|
|
25316
|
-
* - For **Pending effects**: Falls back to the regular `catch` behavior
|
|
25414
|
+
* Success effects pass through unchanged because there is no error to catch.
|
|
25415
|
+
* Failure effects apply the catch function immediately, and pending effects
|
|
25416
|
+
* fall back to regular `catch` behavior.
|
|
25317
25417
|
*
|
|
25318
25418
|
* **Example** (Catching failures eagerly when possible)
|
|
25319
25419
|
*
|