@typed/fx 1.18.4 → 1.20.0

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.
Files changed (423) hide show
  1. package/AsyncData/package.json +6 -0
  2. package/Emitter/package.json +6 -0
  3. package/Form/package.json +6 -0
  4. package/FormEntry/package.json +6 -0
  5. package/Fx/package.json +6 -0
  6. package/Guard/package.json +6 -0
  7. package/Idle/package.json +6 -0
  8. package/Match/package.json +6 -0
  9. package/Pull/package.json +6 -0
  10. package/Push/package.json +6 -0
  11. package/RefArray/package.json +6 -0
  12. package/RefChunk/package.json +6 -0
  13. package/RefHashMap/package.json +6 -0
  14. package/RefHashSet/package.json +6 -0
  15. package/RefSubject/package.json +6 -0
  16. package/Sink/package.json +6 -0
  17. package/Stream/package.json +6 -0
  18. package/Subject/package.json +6 -0
  19. package/TypeId/package.json +6 -0
  20. package/Typeclass/package.json +6 -0
  21. package/Versioned/package.json +6 -0
  22. package/dist/cjs/AsyncData.js +177 -0
  23. package/dist/cjs/AsyncData.js.map +1 -0
  24. package/dist/cjs/Emitter.js +24 -21
  25. package/dist/cjs/Emitter.js.map +1 -1
  26. package/dist/cjs/Form.js +78 -21
  27. package/dist/cjs/Form.js.map +1 -1
  28. package/dist/cjs/FormEntry.js +75 -48
  29. package/dist/cjs/FormEntry.js.map +1 -1
  30. package/dist/cjs/Fx.js +517 -872
  31. package/dist/cjs/Fx.js.map +1 -1
  32. package/dist/cjs/Guard.js +21 -13
  33. package/dist/cjs/Guard.js.map +1 -1
  34. package/dist/cjs/Idle.js +49 -37
  35. package/dist/cjs/Idle.js.map +1 -1
  36. package/dist/cjs/Match.js +99 -61
  37. package/dist/cjs/Match.js.map +1 -1
  38. package/dist/cjs/Pull.js.map +1 -1
  39. package/dist/cjs/Push.js +168 -0
  40. package/dist/cjs/Push.js.map +1 -0
  41. package/dist/cjs/RefArray.js +32 -30
  42. package/dist/cjs/RefArray.js.map +1 -1
  43. package/dist/cjs/RefChunk.js +26 -24
  44. package/dist/cjs/RefChunk.js.map +1 -1
  45. package/dist/cjs/RefHashMap.js +20 -20
  46. package/dist/cjs/RefHashMap.js.map +1 -1
  47. package/dist/cjs/RefHashSet.js +11 -8
  48. package/dist/cjs/RefHashSet.js.map +1 -1
  49. package/dist/cjs/RefSubject.js +899 -158
  50. package/dist/cjs/RefSubject.js.map +1 -1
  51. package/dist/cjs/Sink.js +588 -62
  52. package/dist/cjs/Sink.js.map +1 -1
  53. package/dist/cjs/Stream.js +15 -10
  54. package/dist/cjs/Stream.js.map +1 -1
  55. package/dist/cjs/Subject.js +153 -55
  56. package/dist/cjs/Subject.js.map +1 -1
  57. package/dist/cjs/TypeId.js +10 -5
  58. package/dist/cjs/TypeId.js.map +1 -1
  59. package/dist/cjs/Typeclass.js +28 -31
  60. package/dist/cjs/Typeclass.js.map +1 -1
  61. package/dist/cjs/Versioned.js +118 -57
  62. package/dist/cjs/Versioned.js.map +1 -1
  63. package/dist/cjs/index.js +44 -8
  64. package/dist/cjs/index.js.map +1 -1
  65. package/dist/cjs/internal/{deferred-ref.js → DeferredRef.js} +45 -13
  66. package/dist/cjs/internal/DeferredRef.js.map +1 -0
  67. package/dist/cjs/internal/UnionToTuple.js +6 -0
  68. package/dist/cjs/internal/UnionToTuple.js.map +1 -0
  69. package/dist/cjs/internal/core.js +1590 -779
  70. package/dist/cjs/internal/core.js.map +1 -1
  71. package/dist/cjs/internal/diff.js +114 -0
  72. package/dist/cjs/internal/diff.js.map +1 -0
  73. package/dist/cjs/internal/effect-loop-operator.js +288 -0
  74. package/dist/cjs/internal/effect-loop-operator.js.map +1 -0
  75. package/dist/cjs/internal/effect-operator.js +46 -37
  76. package/dist/cjs/internal/effect-operator.js.map +1 -1
  77. package/dist/cjs/internal/effect-producer.js +74 -0
  78. package/dist/cjs/internal/effect-producer.js.map +1 -0
  79. package/dist/cjs/internal/helpers.js +158 -128
  80. package/dist/cjs/internal/helpers.js.map +1 -1
  81. package/dist/cjs/internal/keyed.js +136 -173
  82. package/dist/cjs/internal/keyed.js.map +1 -1
  83. package/dist/cjs/internal/loop-operator.js +213 -0
  84. package/dist/cjs/internal/loop-operator.js.map +1 -0
  85. package/dist/cjs/internal/operator.js +79 -0
  86. package/dist/cjs/internal/operator.js.map +1 -0
  87. package/dist/cjs/internal/protos.js +19 -81
  88. package/dist/cjs/internal/protos.js.map +1 -1
  89. package/dist/cjs/internal/provide.js +47 -25
  90. package/dist/cjs/internal/provide.js.map +1 -1
  91. package/dist/cjs/internal/requestIdleCallback.js +5 -5
  92. package/dist/cjs/internal/requestIdleCallback.js.map +1 -1
  93. package/dist/cjs/internal/share.js +12 -15
  94. package/dist/cjs/internal/share.js.map +1 -1
  95. package/dist/cjs/internal/sync-operator.js +50 -22
  96. package/dist/cjs/internal/sync-operator.js.map +1 -1
  97. package/dist/cjs/internal/sync-producer.js +114 -0
  98. package/dist/cjs/internal/sync-producer.js.map +1 -0
  99. package/dist/cjs/internal/withKey.js +45 -51
  100. package/dist/cjs/internal/withKey.js.map +1 -1
  101. package/dist/dts/AsyncData.d.ts +185 -0
  102. package/dist/dts/AsyncData.d.ts.map +1 -0
  103. package/dist/dts/Emitter.d.ts +13 -20
  104. package/dist/dts/Emitter.d.ts.map +1 -1
  105. package/dist/dts/Form.d.ts +45 -28
  106. package/dist/dts/Form.d.ts.map +1 -1
  107. package/dist/dts/FormEntry.d.ts +25 -13
  108. package/dist/dts/FormEntry.d.ts.map +1 -1
  109. package/dist/dts/Fx.d.ts +983 -1387
  110. package/dist/dts/Fx.d.ts.map +1 -1
  111. package/dist/dts/Guard.d.ts +8 -1
  112. package/dist/dts/Guard.d.ts.map +1 -1
  113. package/dist/dts/Idle.d.ts +3 -3
  114. package/dist/dts/Idle.d.ts.map +1 -1
  115. package/dist/dts/Match.d.ts +8 -8
  116. package/dist/dts/Match.d.ts.map +1 -1
  117. package/dist/dts/Pull.d.ts +5 -5
  118. package/dist/dts/Pull.d.ts.map +1 -1
  119. package/dist/dts/Push.d.ts +170 -0
  120. package/dist/dts/Push.d.ts.map +1 -0
  121. package/dist/dts/RefArray.d.ts +21 -23
  122. package/dist/dts/RefArray.d.ts.map +1 -1
  123. package/dist/dts/RefChunk.d.ts +17 -19
  124. package/dist/dts/RefChunk.d.ts.map +1 -1
  125. package/dist/dts/RefHashMap.d.ts +19 -20
  126. package/dist/dts/RefHashMap.d.ts.map +1 -1
  127. package/dist/dts/RefHashSet.d.ts +12 -16
  128. package/dist/dts/RefHashSet.d.ts.map +1 -1
  129. package/dist/dts/RefSubject.d.ts +396 -187
  130. package/dist/dts/RefSubject.d.ts.map +1 -1
  131. package/dist/dts/Sink.d.ts +193 -93
  132. package/dist/dts/Sink.d.ts.map +1 -1
  133. package/dist/dts/Stream.d.ts +7 -1
  134. package/dist/dts/Stream.d.ts.map +1 -1
  135. package/dist/dts/Subject.d.ts +27 -36
  136. package/dist/dts/Subject.d.ts.map +1 -1
  137. package/dist/dts/TypeId.d.ts +10 -0
  138. package/dist/dts/TypeId.d.ts.map +1 -1
  139. package/dist/dts/Typeclass.d.ts +2 -2
  140. package/dist/dts/Typeclass.d.ts.map +1 -1
  141. package/dist/dts/Versioned.d.ts +50 -78
  142. package/dist/dts/Versioned.d.ts.map +1 -1
  143. package/dist/dts/index.d.ts +66 -6
  144. package/dist/dts/index.d.ts.map +1 -1
  145. package/dist/dts/internal/DeferredRef.d.ts +20 -0
  146. package/dist/dts/internal/DeferredRef.d.ts.map +1 -0
  147. package/dist/dts/internal/UnionToTuple.d.ts +6 -0
  148. package/dist/dts/internal/UnionToTuple.d.ts.map +1 -0
  149. package/dist/dts/internal/core.d.ts +218 -450
  150. package/dist/dts/internal/core.d.ts.map +1 -1
  151. package/dist/dts/internal/diff.d.ts +38 -0
  152. package/dist/dts/internal/diff.d.ts.map +1 -0
  153. package/dist/dts/internal/effect-loop-operator.d.ts +34 -0
  154. package/dist/dts/internal/effect-loop-operator.d.ts.map +1 -0
  155. package/dist/dts/internal/effect-operator.d.ts +8 -5
  156. package/dist/dts/internal/effect-operator.d.ts.map +1 -1
  157. package/dist/dts/internal/effect-producer.d.ts +25 -0
  158. package/dist/dts/internal/effect-producer.d.ts.map +1 -0
  159. package/dist/dts/internal/helpers.d.ts +33 -24
  160. package/dist/dts/internal/helpers.d.ts.map +1 -1
  161. package/dist/dts/internal/keyed.d.ts +3 -3
  162. package/dist/dts/internal/keyed.d.ts.map +1 -1
  163. package/dist/dts/internal/loop-operator.d.ts +40 -0
  164. package/dist/dts/internal/loop-operator.d.ts.map +1 -0
  165. package/dist/dts/internal/operator.d.ts +16 -0
  166. package/dist/dts/internal/operator.d.ts.map +1 -0
  167. package/dist/dts/internal/protos.d.ts +16 -43
  168. package/dist/dts/internal/protos.d.ts.map +1 -1
  169. package/dist/dts/internal/provide.d.ts +7 -1
  170. package/dist/dts/internal/provide.d.ts.map +1 -1
  171. package/dist/dts/internal/share.d.ts +12 -9
  172. package/dist/dts/internal/share.d.ts.map +1 -1
  173. package/dist/dts/internal/sync-operator.d.ts +7 -3
  174. package/dist/dts/internal/sync-operator.d.ts.map +1 -1
  175. package/dist/dts/internal/sync-producer.d.ts +36 -0
  176. package/dist/dts/internal/sync-producer.d.ts.map +1 -0
  177. package/dist/dts/internal/withKey.d.ts +3 -3
  178. package/dist/dts/internal/withKey.d.ts.map +1 -1
  179. package/dist/esm/AsyncData.js +151 -0
  180. package/dist/esm/AsyncData.js.map +1 -0
  181. package/dist/esm/Emitter.js +24 -21
  182. package/dist/esm/Emitter.js.map +1 -1
  183. package/dist/esm/Form.js +69 -14
  184. package/dist/esm/Form.js.map +1 -1
  185. package/dist/esm/FormEntry.js +77 -52
  186. package/dist/esm/FormEntry.js.map +1 -1
  187. package/dist/esm/Fx.js +509 -874
  188. package/dist/esm/Fx.js.map +1 -1
  189. package/dist/esm/Guard.js +5 -1
  190. package/dist/esm/Guard.js.map +1 -1
  191. package/dist/esm/Idle.js +49 -39
  192. package/dist/esm/Idle.js.map +1 -1
  193. package/dist/esm/Match.js +103 -63
  194. package/dist/esm/Match.js.map +1 -1
  195. package/dist/esm/Pull.js.map +1 -1
  196. package/dist/esm/Push.js +159 -0
  197. package/dist/esm/Push.js.map +1 -0
  198. package/dist/esm/RefArray.js +32 -30
  199. package/dist/esm/RefArray.js.map +1 -1
  200. package/dist/esm/RefChunk.js +26 -24
  201. package/dist/esm/RefChunk.js.map +1 -1
  202. package/dist/esm/RefHashMap.js +20 -20
  203. package/dist/esm/RefHashMap.js.map +1 -1
  204. package/dist/esm/RefHashSet.js +11 -8
  205. package/dist/esm/RefHashSet.js.map +1 -1
  206. package/dist/esm/RefSubject.js +873 -150
  207. package/dist/esm/RefSubject.js.map +1 -1
  208. package/dist/esm/Sink.js +608 -57
  209. package/dist/esm/Sink.js.map +1 -1
  210. package/dist/esm/Stream.js +13 -9
  211. package/dist/esm/Stream.js.map +1 -1
  212. package/dist/esm/Subject.js +151 -56
  213. package/dist/esm/Subject.js.map +1 -1
  214. package/dist/esm/TypeId.js +9 -4
  215. package/dist/esm/TypeId.js.map +1 -1
  216. package/dist/esm/Typeclass.js +29 -29
  217. package/dist/esm/Typeclass.js.map +1 -1
  218. package/dist/esm/Versioned.js +110 -53
  219. package/dist/esm/Versioned.js.map +1 -1
  220. package/dist/esm/index.js +66 -6
  221. package/dist/esm/index.js.map +1 -1
  222. package/dist/esm/internal/DeferredRef.js +54 -0
  223. package/dist/esm/internal/DeferredRef.js.map +1 -0
  224. package/dist/esm/internal/UnionToTuple.js +2 -0
  225. package/dist/esm/internal/UnionToTuple.js.map +1 -0
  226. package/dist/esm/internal/core.js +1439 -719
  227. package/dist/esm/internal/core.js.map +1 -1
  228. package/dist/esm/internal/diff.js +82 -0
  229. package/dist/esm/internal/diff.js.map +1 -0
  230. package/dist/esm/internal/effect-loop-operator.js +269 -0
  231. package/dist/esm/internal/effect-loop-operator.js.map +1 -0
  232. package/dist/esm/internal/effect-operator.js +44 -37
  233. package/dist/esm/internal/effect-operator.js.map +1 -1
  234. package/dist/esm/internal/effect-producer.js +47 -0
  235. package/dist/esm/internal/effect-producer.js.map +1 -0
  236. package/dist/esm/internal/helpers.js +157 -129
  237. package/dist/esm/internal/helpers.js.map +1 -1
  238. package/dist/esm/internal/keyed.js +128 -139
  239. package/dist/esm/internal/keyed.js.map +1 -1
  240. package/dist/esm/internal/loop-operator.js +186 -0
  241. package/dist/esm/internal/loop-operator.js.map +1 -0
  242. package/dist/esm/internal/operator.js +68 -0
  243. package/dist/esm/internal/operator.js.map +1 -0
  244. package/dist/esm/internal/protos.js +16 -75
  245. package/dist/esm/internal/protos.js.map +1 -1
  246. package/dist/esm/internal/provide.js +33 -25
  247. package/dist/esm/internal/provide.js.map +1 -1
  248. package/dist/esm/internal/requestIdleCallback.js +5 -5
  249. package/dist/esm/internal/requestIdleCallback.js.map +1 -1
  250. package/dist/esm/internal/share.js +12 -12
  251. package/dist/esm/internal/share.js.map +1 -1
  252. package/dist/esm/internal/sync-operator.js +49 -21
  253. package/dist/esm/internal/sync-operator.js.map +1 -1
  254. package/dist/esm/internal/sync-producer.js +88 -0
  255. package/dist/esm/internal/sync-producer.js.map +1 -0
  256. package/dist/esm/internal/withKey.js +46 -47
  257. package/dist/esm/internal/withKey.js.map +1 -1
  258. package/package.json +22 -62
  259. package/src/AsyncData.ts +447 -0
  260. package/src/Emitter.ts +47 -38
  261. package/src/Form.ts +185 -65
  262. package/src/FormEntry.ts +142 -109
  263. package/src/Fx.ts +1685 -1851
  264. package/src/Guard.ts +12 -1
  265. package/src/Idle.ts +76 -62
  266. package/src/Match.ts +149 -93
  267. package/src/Pull.ts +8 -8
  268. package/src/Push.ts +472 -0
  269. package/src/RefArray.ts +53 -51
  270. package/src/RefChunk.ts +44 -41
  271. package/src/RefHashMap.ts +57 -43
  272. package/src/RefHashSet.ts +21 -31
  273. package/src/RefSubject.ts +1984 -457
  274. package/src/Sink.ts +922 -171
  275. package/src/Stream.ts +32 -20
  276. package/src/Subject.ts +230 -87
  277. package/src/TypeId.ts +16 -4
  278. package/src/Typeclass.ts +31 -32
  279. package/src/Versioned.ts +220 -168
  280. package/src/index.ts +78 -6
  281. package/src/internal/DeferredRef.ts +62 -0
  282. package/src/internal/UnionToTuple.ts +11 -0
  283. package/src/internal/core.ts +2491 -1950
  284. package/src/internal/diff.ts +157 -0
  285. package/src/internal/effect-loop-operator.ts +466 -0
  286. package/src/internal/effect-operator.ts +89 -54
  287. package/src/internal/effect-producer.ts +125 -0
  288. package/src/internal/helpers.ts +275 -205
  289. package/src/internal/keyed.ts +192 -241
  290. package/src/internal/loop-operator.ts +266 -0
  291. package/src/internal/operator.ts +87 -0
  292. package/src/internal/protos.ts +29 -104
  293. package/src/internal/provide.ts +48 -40
  294. package/src/internal/requestIdleCallback.ts +5 -6
  295. package/src/internal/share.ts +26 -24
  296. package/src/internal/sync-operator.ts +68 -27
  297. package/src/internal/sync-producer.ts +146 -0
  298. package/src/internal/withKey.ts +64 -74
  299. package/dist/cjs/Computed.js +0 -115
  300. package/dist/cjs/Computed.js.map +0 -1
  301. package/dist/cjs/Filtered.js +0 -95
  302. package/dist/cjs/Filtered.js.map +0 -1
  303. package/dist/cjs/Model.js +0 -119
  304. package/dist/cjs/Model.js.map +0 -1
  305. package/dist/cjs/RefAsyncData.js +0 -187
  306. package/dist/cjs/RefAsyncData.js.map +0 -1
  307. package/dist/cjs/RefAsyncDataArray.js +0 -38
  308. package/dist/cjs/RefAsyncDataArray.js.map +0 -1
  309. package/dist/cjs/RefBoolean.js +0 -45
  310. package/dist/cjs/RefBoolean.js.map +0 -1
  311. package/dist/cjs/RefNumber.js +0 -49
  312. package/dist/cjs/RefNumber.js.map +0 -1
  313. package/dist/cjs/internal/core-ref-subject.js +0 -254
  314. package/dist/cjs/internal/core-ref-subject.js.map +0 -1
  315. package/dist/cjs/internal/core-subject.js +0 -108
  316. package/dist/cjs/internal/core-subject.js.map +0 -1
  317. package/dist/cjs/internal/deferred-ref.js.map +0 -1
  318. package/dist/cjs/internal/effect-primitive.js +0 -47
  319. package/dist/cjs/internal/effect-primitive.js.map +0 -1
  320. package/dist/cjs/internal/fx-effect-proto.js +0 -58
  321. package/dist/cjs/internal/fx-effect-proto.js.map +0 -1
  322. package/dist/cjs/internal/fx-primitive.js +0 -193
  323. package/dist/cjs/internal/fx-primitive.js.map +0 -1
  324. package/dist/cjs/internal/fx.js +0 -240
  325. package/dist/cjs/internal/fx.js.map +0 -1
  326. package/dist/cjs/internal/matchers.js +0 -34
  327. package/dist/cjs/internal/matchers.js.map +0 -1
  328. package/dist/cjs/internal/run.js +0 -54
  329. package/dist/cjs/internal/run.js.map +0 -1
  330. package/dist/cjs/internal/schema-ref-subject.js +0 -132
  331. package/dist/cjs/internal/schema-ref-subject.js.map +0 -1
  332. package/dist/cjs/internal/versioned-transform.js +0 -46
  333. package/dist/cjs/internal/versioned-transform.js.map +0 -1
  334. package/dist/dts/Computed.d.ts +0 -106
  335. package/dist/dts/Computed.d.ts.map +0 -1
  336. package/dist/dts/Filtered.d.ts +0 -97
  337. package/dist/dts/Filtered.d.ts.map +0 -1
  338. package/dist/dts/Model.d.ts +0 -200
  339. package/dist/dts/Model.d.ts.map +0 -1
  340. package/dist/dts/RefAsyncData.d.ts +0 -236
  341. package/dist/dts/RefAsyncData.d.ts.map +0 -1
  342. package/dist/dts/RefAsyncDataArray.d.ts +0 -56
  343. package/dist/dts/RefAsyncDataArray.d.ts.map +0 -1
  344. package/dist/dts/RefBoolean.d.ts +0 -47
  345. package/dist/dts/RefBoolean.d.ts.map +0 -1
  346. package/dist/dts/RefNumber.d.ts +0 -48
  347. package/dist/dts/RefNumber.d.ts.map +0 -1
  348. package/dist/dts/internal/core-ref-subject.d.ts +0 -100
  349. package/dist/dts/internal/core-ref-subject.d.ts.map +0 -1
  350. package/dist/dts/internal/core-subject.d.ts +0 -5
  351. package/dist/dts/internal/core-subject.d.ts.map +0 -1
  352. package/dist/dts/internal/deferred-ref.d.ts +0 -12
  353. package/dist/dts/internal/deferred-ref.d.ts.map +0 -1
  354. package/dist/dts/internal/effect-primitive.d.ts +0 -6
  355. package/dist/dts/internal/effect-primitive.d.ts.map +0 -1
  356. package/dist/dts/internal/fx-effect-proto.d.ts +0 -30
  357. package/dist/dts/internal/fx-effect-proto.d.ts.map +0 -1
  358. package/dist/dts/internal/fx-primitive.d.ts +0 -109
  359. package/dist/dts/internal/fx-primitive.d.ts.map +0 -1
  360. package/dist/dts/internal/fx.d.ts +0 -245
  361. package/dist/dts/internal/fx.d.ts.map +0 -1
  362. package/dist/dts/internal/matchers.d.ts +0 -33
  363. package/dist/dts/internal/matchers.d.ts.map +0 -1
  364. package/dist/dts/internal/run.d.ts +0 -8
  365. package/dist/dts/internal/run.d.ts.map +0 -1
  366. package/dist/dts/internal/schema-ref-subject.d.ts +0 -5
  367. package/dist/dts/internal/schema-ref-subject.d.ts.map +0 -1
  368. package/dist/dts/internal/versioned-transform.d.ts +0 -17
  369. package/dist/dts/internal/versioned-transform.d.ts.map +0 -1
  370. package/dist/esm/Computed.js +0 -103
  371. package/dist/esm/Computed.js.map +0 -1
  372. package/dist/esm/Filtered.js +0 -83
  373. package/dist/esm/Filtered.js.map +0 -1
  374. package/dist/esm/Model.js +0 -100
  375. package/dist/esm/Model.js.map +0 -1
  376. package/dist/esm/RefAsyncData.js +0 -163
  377. package/dist/esm/RefAsyncData.js.map +0 -1
  378. package/dist/esm/RefAsyncDataArray.js +0 -27
  379. package/dist/esm/RefAsyncDataArray.js.map +0 -1
  380. package/dist/esm/RefBoolean.js +0 -31
  381. package/dist/esm/RefBoolean.js.map +0 -1
  382. package/dist/esm/RefNumber.js +0 -35
  383. package/dist/esm/RefNumber.js.map +0 -1
  384. package/dist/esm/internal/core-ref-subject.js +0 -242
  385. package/dist/esm/internal/core-ref-subject.js.map +0 -1
  386. package/dist/esm/internal/core-subject.js +0 -90
  387. package/dist/esm/internal/core-subject.js.map +0 -1
  388. package/dist/esm/internal/deferred-ref.js +0 -23
  389. package/dist/esm/internal/deferred-ref.js.map +0 -1
  390. package/dist/esm/internal/effect-primitive.js +0 -41
  391. package/dist/esm/internal/effect-primitive.js.map +0 -1
  392. package/dist/esm/internal/fx-effect-proto.js +0 -43
  393. package/dist/esm/internal/fx-effect-proto.js.map +0 -1
  394. package/dist/esm/internal/fx-primitive.js +0 -175
  395. package/dist/esm/internal/fx-primitive.js.map +0 -1
  396. package/dist/esm/internal/fx.js +0 -216
  397. package/dist/esm/internal/fx.js.map +0 -1
  398. package/dist/esm/internal/matchers.js +0 -38
  399. package/dist/esm/internal/matchers.js.map +0 -1
  400. package/dist/esm/internal/run.js +0 -32
  401. package/dist/esm/internal/run.js.map +0 -1
  402. package/dist/esm/internal/schema-ref-subject.js +0 -121
  403. package/dist/esm/internal/schema-ref-subject.js.map +0 -1
  404. package/dist/esm/internal/versioned-transform.js +0 -37
  405. package/dist/esm/internal/versioned-transform.js.map +0 -1
  406. package/src/Computed.ts +0 -289
  407. package/src/Filtered.ts +0 -274
  408. package/src/Model.ts +0 -483
  409. package/src/RefAsyncData.ts +0 -547
  410. package/src/RefAsyncDataArray.ts +0 -135
  411. package/src/RefBoolean.ts +0 -71
  412. package/src/RefNumber.ts +0 -77
  413. package/src/internal/core-ref-subject.ts +0 -528
  414. package/src/internal/core-subject.ts +0 -143
  415. package/src/internal/deferred-ref.ts +0 -26
  416. package/src/internal/effect-primitive.ts +0 -230
  417. package/src/internal/fx-effect-proto.ts +0 -56
  418. package/src/internal/fx-primitive.ts +0 -223
  419. package/src/internal/fx.ts +0 -619
  420. package/src/internal/matchers.ts +0 -83
  421. package/src/internal/run.ts +0 -51
  422. package/src/internal/schema-ref-subject.ts +0 -163
  423. package/src/internal/versioned-transform.ts +0 -48
package/dist/cjs/Fx.js CHANGED
@@ -3,1263 +3,780 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.fromStream = exports.fromSink = exports.fromScheduled = exports.fromPubSub = exports.fromNullable = exports.fromIterable = exports.fromFxEffect = exports.fromEmitter = exports.fromEffect = exports.fromDequeue = exports.from = exports.forkScoped = exports.forkIn = exports.forkDaemon = exports.fork = exports.flip = exports.flatten = exports.flatMapWithStrategy = exports.flatMapErrorWithStrategy = exports.flatMapErrorConcurrently = exports.flatMapError = exports.flatMapConcurrently = exports.flatMapCauseWithStrategy = exports.flatMapCauseConcurrently = exports.flatMapCause = exports.flatMap = exports.first = exports.findFirst = exports.filterMapErrorEffect = exports.filterMapError = exports.filterMapEffect = exports.filterMapCause = exports.filterMap = exports.filterErrorCause = exports.filterError = exports.filterEffect = exports.filter = exports.failCause = exports.fail = exports.exit = exports.exhaustMatchCause = exports.exhaustMatch = exports.exhaustMapLatestError = exports.exhaustMapLatestCause = exports.exhaustMapLatest = exports.exhaustMapError = exports.exhaustMapCause = exports.exhaustMap = exports.exhaustLatestMatchCause = exports.exhaustLatestMatch = exports.exhaustLatest = exports.exhaust = exports.ensuring = exports.endWith = exports.empty = exports.either = exports.during = exports.dropWhile = exports.dropUntil = exports.dropAfter = exports.drop = exports.drainLayer = exports.drain = exports.die = exports.delay = exports.debounce = exports.continueWith = exports.concatMap = exports.compact = exports.combine = exports.bindTo = exports.bind = exports.at = exports.annotateSpans = exports.annotateLogs = exports.acquireUseRelease = exports.Unordered = exports.Unbounded = exports.ToFx = exports.Switch = exports.Ordered = exports.FxEffectBase = exports.ExhaustLatest = exports.Exhaust = exports.Do = exports.Bounded = void 0;
7
- exports.gen = gen;
8
- exports.genScoped = genScoped;
9
- exports.interruptible = exports.interrupt = exports.if = exports.hold = exports.getOrElse = void 0;
6
+ exports.delay = exports.debounce = exports.continueWith = exports.concatMap = exports.compact = exports.at = exports.appendAll = exports.append = exports.annotateSpans = exports.annotateLogs = exports.all = exports.acquireUseRelease = exports.Unordered = exports.Unbounded = exports.Switch = exports.Ordered = exports.FxEffectBase = exports.ExhaustLatest = exports.Exhaust = exports.Bounded = void 0;
7
+ exports.dequeueIsActive = dequeueIsActive;
8
+ exports.drain = exports.die = void 0;
9
+ exports.drainLayer = drainLayer;
10
+ exports.fromAsyncIterable = exports.fromArray = exports.forkScoped = exports.forkIn = exports.forkDaemon = exports.fork = exports.flip = exports.flatMapWithStrategy = exports.flatMapErrorWithStrategy = exports.flatMapErrorConcurrently = exports.flatMapError = exports.flatMapEffect = exports.flatMapConcurrentlyEffect = exports.flatMapConcurrently = exports.flatMapCauseWithStrategy = exports.flatMapCauseConcurrently = exports.flatMapCause = exports.flatMap = exports.first = exports.findFirst = exports.filterMapLoopErrorEffect = exports.filterMapLoopError = exports.filterMapLoopEffect = exports.filterMapLoopCauseEffect = exports.filterMapLoopCause = exports.filterMapLoop = exports.filterMapErrorEffect = exports.filterMapError = exports.filterMapEffect = exports.filterMapCauseEffect = exports.filterMapCause = exports.filterMap = exports.filterErrorEffect = exports.filterError = exports.filterEffect = exports.filterCauseEffect = exports.filterCause = exports.filter = exports.failCause = exports.fail = exports.exit = exports.exhaustMatchLatestError = exports.exhaustMatchLatestCause = exports.exhaustMatchError = exports.exhaustMatchCause = exports.exhaustMapLatestError = exports.exhaustMapLatestEffect = exports.exhaustMapLatestCause = exports.exhaustMapLatest = exports.exhaustMapError = exports.exhaustMapEffect = exports.exhaustMapCause = exports.exhaustMap = exports.ensuring = exports.empty = exports.either = exports.during = exports.dropWhileEffect = exports.dropWhile = exports.dropUntilEffect = exports.dropUntil = exports.dropAfterEffect = exports.dropAfter = exports.drop = void 0;
11
+ exports.fromDequeue = fromDequeue;
12
+ exports.fromNullable = exports.fromIterable = exports.fromFxEffect = exports.fromEffect = void 0;
13
+ exports.fromPubSub = fromPubSub;
14
+ exports.if = exports.hold = exports.getOrElse = exports.genScoped = exports.gen = exports.fromScheduled = void 0;
15
+ exports.interruptible = void 0;
10
16
  exports.isFx = isFx;
11
- exports.loopEffect = exports.loop = exports.locallyWith = exports.locally = exports.let = exports.keyed = void 0;
12
- exports.withTracerTiming = exports.withTracer = exports.withSpan = exports.withScopedFork = exports.withScheduler = exports.withRequestCaching = exports.withRequestCache = exports.withRequestBatching = exports.withPrevious = exports.withParentSpan = exports.withMaxOpsBeforeYield = exports.withLogSpan = exports.withKey = exports.withFlattenStrategy = exports.withEarlyExit = exports.withConcurrency = exports.when = exports.until = exports.uninterruptible = exports.toReadonlyArray = exports.toEnqueue = exports.toChunk = exports.toArray = exports.throttle = exports.tap = exports.takeWhile = exports.takeUntil = exports.take = exports.sync = exports.switchMatchCause = exports.switchMatch = exports.switchMapError = exports.switchMapCause = exports.switchMap = exports.switchLatest = exports.suspend = exports.succeedSome = exports.succeedNone = exports.succeed = exports.struct = exports.startWith = exports.snapshot = exports.slice = exports.skipRepeatsWith = exports.skipRepeats = exports.since = exports.share = exports.scoped = exports.scanEffect = exports.scan = exports.run = exports.replay = exports.reduce = exports.race = exports.provideServiceEffect = exports.provideService = exports.provide = exports.periodic = exports.partitionMap = exports.orElse = exports.onInterrupt = exports.onExit = exports.onError = exports.observe = exports.never = exports.multicast = exports.middleware = exports.mergeSwitch = exports.mergeRace = exports.mergeConcurrently = exports.mergeBufferConcurrently = exports.mergeBuffer = exports.merge = exports.matchTags = exports.matchOption = exports.matchErrorWithStrategy = exports.matchErrorConcurrently = exports.matchEither = exports.matchCauseWithStrategy = exports.matchCauseConcurrently = exports.matchCause = exports.match = exports.mapErrorCause = exports.mapError = exports.mapEffect = exports.mapBoth = exports.map = void 0;
17
+ exports.withKey = exports.withEmitter = exports.withConfigProvider = exports.withConcurrency = exports.when = exports.until = exports.uninterruptible = exports.tuple = exports.toReadonlyArray = exports.toEnqueue = exports.throttleLatest = exports.throttle = exports.tapEffect = exports.tap = exports.takeWhileEffect = exports.takeWhile = exports.takeUntil = exports.takeUntiEffect = exports.take = exports.sync = exports.switchMatchError = exports.switchMatchCause = exports.switchMapError = exports.switchMapEffect = exports.switchMapCause = exports.switchMap = exports.suspend = exports.succeed = exports.struct = exports.snapshotEffect = exports.snapshot = exports.slice = exports.skipRepeatsWith = exports.skipRepeats = exports.since = exports.share = exports.scoped = exports.schedule = exports.scan = exports.sample = exports.replay = exports.reduce = exports.raceAll = exports.race = exports.provideServiceEffect = exports.provideService = exports.provideRuntime = exports.provideLayer = exports.provideContext = exports.provide = exports.prependAll = exports.prepend = exports.periodic = exports.partitionMap = exports.padWith = exports.orElseCause = exports.orElse = exports.onInterrupt = exports.onExit = exports.onError = exports.observe = exports.never = exports.multicast = exports.middleware = exports.mergeWithStrategy = exports.mergeSwitch = exports.mergeRace = exports.mergeOrderedConcurrently = exports.mergeOrdered = exports.mergeFirst = exports.mergeAll = exports.merge = exports.matchTags = exports.matchOption = exports.matchErrorWithStrategy = exports.matchErrorConcurrently = exports.matchError = exports.matchEither = exports.matchCauseWithStrategy = exports.matchCauseConcurrently = exports.matchCause = exports.mapErrorEffect = exports.mapError = exports.mapEffect = exports.mapCauseEffect = exports.mapCause = exports.mapBoth = exports.map = exports.make = exports.loopErrorEffect = exports.loopError = exports.loopEffect = exports.loopCauseEffect = exports.loopCause = exports.loop = exports.locallyWith = exports.locally = exports.keyed = void 0;
18
+ exports.withTracerTiming = exports.withTracer = exports.withSpan = exports.withRequestCaching = exports.withRequestCache = exports.withRequestBatching = exports.withParentSpan = exports.withMaxOpsBeforeYield = exports.withLogSpan = void 0;
13
19
  var Cause = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Cause"));
14
20
  var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect"));
15
21
  var Either = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Either"));
16
22
  var _Function = /*#__PURE__*/require("effect/Function");
23
+ var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer"));
17
24
  var Option = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Option"));
25
+ var _Predicate = /*#__PURE__*/require("effect/Predicate");
26
+ var Queue = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Queue"));
27
+ var Schedule = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Schedule"));
28
+ var Emitter = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./Emitter.js"));
18
29
  var core = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/core.js"));
19
- var primitive = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/fx-primitive.js"));
20
- var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/fx.js"));
21
- var internalKeyed = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/keyed.js"));
22
- var internalProtos = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/protos.js"));
23
- var internalRun = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/run.js"));
24
- var Share = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/share.js"));
30
+ var coreKeyed = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/keyed.js"));
31
+ var protos = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/protos.js"));
32
+ var coreShare = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/share.js"));
25
33
  var strategies = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/strategies.js"));
26
- var internalWithKey = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/withKey.js"));
34
+ var coreWithKey = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./internal/withKey.js"));
27
35
  var _RefSubject = /*#__PURE__*/require("./RefSubject.js");
36
+ var Sink = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("./Sink.js"));
28
37
  var _TypeId = /*#__PURE__*/require("./TypeId.js");
29
38
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
30
39
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
31
40
  /**
32
- * Fx<R, E, A> is a representation of an `Effect`-ful workflow that exists over
33
- * the time dimension. It operates within a context `R`, can fail with an `E`,
34
- * and succeed with an `A`.
35
- *
36
- * Any `Fx`, shorthand for "Effects", can emit 0 or more errors or events over an
37
- * indefinite period of time. This is in contrast to `Effect` which can only
38
- * produce exactly 1 error or event.
39
- *
40
- * It is defined as a super-type of `Effect`, `Stream`, and `Cause`. This
41
- * allows for all operators that accept an `Fx` to also capable of
42
- * accepting an `Effect`, `Stream`, or `Cause`. An Effect or Cause represents a single
43
- * event or error, while a Stream represents a series of events or errors that will
44
- * be pulled from the producer as soon as possible.
45
- *
46
- * @since 1.18.0
41
+ * Fx is a push-based reactive primitive built atop of Effect.
42
+ * @since 1.20.0
47
43
  */
48
44
 
45
+ /**
46
+ * @since 1.20.0
47
+ */
48
+ function isFx(u) {
49
+ return u === null ? false : (0, _Predicate.hasProperty)(u, _TypeId.TypeId);
50
+ }
49
51
  /**
50
52
  * Singleton instance of Unbounded
51
- * @since 1.18.0
53
+ * @since 1.20.0
52
54
  * @category FlattenStrategy
53
55
  */
54
56
  const Unbounded = exports.Unbounded = strategies.Unbounded;
55
57
  /**
56
58
  * Construct a Bounded strategy
57
- * @since 1.18.0
59
+ * @since 1.20.0
58
60
  * @category FlattenStrategy
59
61
  */
60
62
  const Bounded = exports.Bounded = strategies.Bounded;
61
63
  /**
62
64
  * Singleton instance of Switch
63
- * @since 1.18.0
65
+ * @since 1.20.0
64
66
  * @category FlattenStrategy
65
67
  */
66
68
  const Switch = exports.Switch = strategies.Switch;
67
69
  /**
68
70
  * Singleton instance of Exhaust
69
- * @since 1.18.0
71
+ * @since 1.20.0
70
72
  * @category FlattenStrategy
71
73
  */
72
74
  const Exhaust = exports.Exhaust = strategies.Exhaust;
73
75
  /**
74
76
  * Singleton instance of ExhaustLatest
75
- * @since 1.18.0
77
+ * @since 1.20.0
76
78
  * @category FlattenStrategy
77
79
  */
78
80
  const ExhaustLatest = exports.ExhaustLatest = strategies.ExhaustLatest;
79
81
  /**
80
82
  * Construct an Unordered strategy
81
- * @since 1.18.0
83
+ * @since 1.20.0
82
84
  * @category MergeStrategy
83
85
  */
84
86
  const Unordered = exports.Unordered = strategies.Unordered;
85
87
  /**
86
88
  * Construct an Ordered strategy
87
- * @since 1.18.0
89
+ * @since 1.20.0
88
90
  * @category MergeStrategy
89
91
  */
90
92
  const Ordered = exports.Ordered = strategies.Ordered;
91
- /* #endregion */
92
- /* #region Constructor */
93
- /* #region Core */
94
93
  /**
95
- * An Fx which will immediately end producing 0 events and 0 errors.
96
- * @since 1.18.0
97
- * @category constructors
94
+ * @since 1.20.0
98
95
  */
99
- const empty = exports.empty = core.empty;
96
+ const make = exports.make = core.make;
100
97
  /**
101
- * Construct an Fx<never, E, A> from a Cause<E>
102
- * @since 1.18.0
103
- * @category constructors
98
+ * @since 1.20.0
104
99
  */
105
- const failCause = exports.failCause = core.failCause;
100
+ const succeed = exports.succeed = core.succeed;
106
101
  /**
107
- * Construct an Fx<never, never, never> from a defect
108
- * @since 1.18.0
109
- * @category constructors
102
+ * @since 1.20.0
110
103
  */
111
- const die = defect => failCause(Cause.die(defect));
104
+ const sync = exports.sync = core.fromSync;
112
105
  /**
113
- * Interrupt the current Fx with the specified FiberId
114
- * @since 1.18.0
115
- * @category constructors
106
+ * @since 1.20.0
116
107
  */
117
- exports.die = die;
118
- const interrupt = id => failCause(Cause.interrupt(id));
108
+ const fromArray = exports.fromArray = core.fromArray;
119
109
  /**
120
- * Construct an Fx which will fail with the specified error.
121
- * @since 1.18.0
122
- * @category constructors
110
+ * @since 1.20.0
123
111
  */
124
- exports.interrupt = interrupt;
125
- const fail = exports.fail = core.fail;
112
+ const fromIterable = exports.fromIterable = core.fromIterable;
126
113
  /**
127
- * Construct an Fx<R, E, A> from an Effect<R, E, A>
128
- * @since 1.18.0
129
- * @category constructors
114
+ * @since 1.20.0
130
115
  */
131
116
  const fromEffect = exports.fromEffect = core.fromEffect;
132
117
  /**
133
- * Construct an Fx from an Iterable
134
- * @since 1.18.0
135
- * @category constructors
118
+ * @since 1.20.0
136
119
  */
137
- const fromIterable = exports.fromIterable = core.fromIterable;
120
+ const fromScheduled = exports.fromScheduled = /*#__PURE__*/(0, _Function.dual)(2, core.fromScheduled);
138
121
  /**
139
- * Construct an Fx<R, E, A> from an Effect<R, E, A>
140
- * @since 1.18.0
141
- * @category constructors
122
+ * @since 1.20.0
142
123
  */
143
- const fromStream = exports.fromStream = core.fromStream;
124
+ const schedule = exports.schedule = /*#__PURE__*/(0, _Function.dual)(2, core.schedule);
144
125
  /**
145
- * Construct an Fx<R, E, A> from an Effect<R, E, A>
146
- * @since 1.18.0
147
- * @category constructors
126
+ * @since 1.20.0
148
127
  */
149
- const from = exports.from = core.from;
128
+ const periodic = exports.periodic = /*#__PURE__*/(0, _Function.dual)(2, (iterator, period) => continueWith(fromEffect(iterator), () => schedule(iterator, Schedule.spaced(period))));
150
129
  /**
151
- * Construct an Fx by describing an Effectful workflow that has access to a Sink
152
- * to emit events and errors.
153
- * @since 1.18.0
154
- * @category constructors
130
+ * @since 1.20.0
155
131
  */
156
- const fromSink = exports.fromSink = core.fromSink;
132
+ const failCause = exports.failCause = core.failCause;
157
133
  /**
158
- * Construct an Fx by describing an Scoped Effect that has access to an Emitter
159
- * to emit events and errors.
160
- * @since 1.18.0
161
- * @category constructors
134
+ * @since 1.20.0
162
135
  */
163
- const fromEmitter = exports.fromEmitter = core.fromEmitter;
136
+ const fail = exports.fail = core.fail;
164
137
  /**
165
- * An Fx which will never emit any errors or events, and will never end
166
- * @since 1.18.0
167
- * @category constructors
138
+ * @since 1.20.0
168
139
  */
169
- const never = exports.never = core.never;
140
+ const die = exports.die = core.die;
170
141
  /**
171
- * Construct an Fx which will emit the specified value and then end.
172
- * @since 1.18.0
173
- * @category constructors
142
+ * @since 1.20.0
174
143
  */
175
- const succeed = exports.succeed = core.succeed;
144
+ const map = exports.map = /*#__PURE__*/(0, _Function.dual)(2, core.map);
176
145
  /**
177
- * Construct an Fx which will emit the return of a synchronous function and then end.
178
- * @since 1.18.0
179
- * @category constructors
146
+ * @since 1.20.0
180
147
  */
181
- const sync = exports.sync = core.sync;
148
+ const filter = exports.filter = /*#__PURE__*/(0, _Function.dual)(2, core.filter);
182
149
  /**
183
- * Lazily construct an Fx.
184
- * @since 1.18.0
185
- * @category constructors
150
+ * @since 1.20.0
186
151
  */
187
- const suspend = exports.suspend = core.suspend;
152
+ const filterMap = exports.filterMap = /*#__PURE__*/(0, _Function.dual)(2, core.filterMap);
188
153
  /**
189
- * Helper for constructing your own custom subtypes of an Fx
190
- * @since 1.18.0
191
- * @category Subtyping
154
+ * @since 1.20.0
192
155
  */
193
- class ToFx extends primitive.ToFx {}
156
+ const compact = fx => filterMap(fx, _Function.identity);
194
157
  /**
195
- * Create an Fx which will emit a value after waiting for a specified duration.
196
- * @since 1.18.0
197
- * @category constructors
158
+ * @since 1.20.0
198
159
  */
199
- exports.ToFx = ToFx;
200
- const at = exports.at = internal.at;
160
+ exports.compact = compact;
161
+ const mapEffect = exports.mapEffect = /*#__PURE__*/(0, _Function.dual)(2, core.mapEffect);
201
162
  /**
202
- * Construct an Fx which can fork effects into a Scope.
203
- * @since 1.18.0
204
- * @category constructors
163
+ * @since 1.20.0
205
164
  */
206
- const withScopedFork = exports.withScopedFork = core.withScopedFork;
165
+ const filterMapEffect = exports.filterMapEffect = /*#__PURE__*/(0, _Function.dual)(2, core.filterMapEffect);
207
166
  /**
208
- * Construct an Fx which can exit early from a Scope.
209
- * @since 1.18.0
210
- * @category constructors
167
+ * @since 1.20.0
211
168
  */
212
- const withEarlyExit = exports.withEarlyExit = core.withEarlyExit;
169
+ const filterEffect = exports.filterEffect = /*#__PURE__*/(0, _Function.dual)(2, core.filterEffect);
213
170
  /**
214
- * Construct an Fx which can flatten nested Fx.
215
- * @since 1.18.0
216
- * @category constructors
171
+ * @since 1.20.0
217
172
  */
218
- const withFlattenStrategy = exports.withFlattenStrategy = core.withFlattenStrategy;
219
- /* #endregion */
220
- /* #region Additions */
173
+ const tapEffect = exports.tapEffect = /*#__PURE__*/(0, _Function.dual)(2, core.tapEffect);
221
174
  /**
222
- * Acquire a resource, use it to construct an Fx, and then release the resource
223
- * after the Fx has exited.
224
- *
225
- * @since 1.18.0
226
- * @category constructors
175
+ * @since 1.20.0
227
176
  */
228
- const acquireUseRelease = exports.acquireUseRelease = core.acquireUseRelease;
177
+ const tap = exports.tap = /*#__PURE__*/(0, _Function.dual)(2, (fx, f) => tapEffect(fx, a => Effect.sync(() => f(a))));
229
178
  /**
230
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
231
- * as a tuple of values.
232
- *
233
- * @since 1.18.0
234
- * @category constructors
179
+ * @since 1.20.0
235
180
  */
236
- const combine = exports.combine = core.combine;
181
+ const loop = exports.loop = /*#__PURE__*/(0, _Function.dual)(3, core.loop);
237
182
  /**
238
- * Combine a record of Fx into a single Fx that will emit the results of all Fx
239
- * as a record of values.
240
- *
241
- * @since 1.18.0
242
- * @category constructors
183
+ * @since 1.20.0
243
184
  */
244
- const struct = fx => map(combine(Object.entries(fx).map(([k, fx]) => map(fx, v => [k, v]))), Object.fromEntries);
185
+ const filterMapLoop = exports.filterMapLoop = /*#__PURE__*/(0, _Function.dual)(3, core.filterMapLoop);
245
186
  /**
246
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
247
- * as they occur.
248
- * @since 1.18.0
249
- * @category constructors
187
+ * @since 1.20.0
250
188
  */
251
- exports.struct = struct;
252
- const merge = exports.merge = core.merge;
189
+ const loopEffect = exports.loopEffect = /*#__PURE__*/(0, _Function.dual)(3, core.loopEffect);
253
190
  /**
254
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
255
- * as they occur, but only allowing `n` concurrent Fx to run at a time.
256
- *
257
- * @since 1.18.0
258
- * @category constructors
191
+ * @since 1.20.0
259
192
  */
260
- const mergeConcurrently = exports.mergeConcurrently = core.mergeConcurrently;
193
+ const filterMapLoopEffect = exports.filterMapLoopEffect = /*#__PURE__*/(0, _Function.dual)(3, core.filterMapLoopEffect);
261
194
  /**
262
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
263
- * in the order the Fx were provided. All Fx will be executed concurrently,
264
- * and the results will be buffered if necessary to preserve ordering.
265
- *
266
- * @since 1.18.0
267
- * @category constructors
195
+ * @since 1.20.0
268
196
  */
269
- const mergeBuffer = exports.mergeBuffer = core.mergeBuffer;
197
+ const observe = exports.observe = /*#__PURE__*/(0, _Function.dual)(2, core.observe);
270
198
  /**
271
- * Combine multiple Fx into a single Fx that will emit the results of all Fx
272
- * in the order the Fx were provided. All Fx will be executed concurrently, limited
273
- * by the provided concurrency, and the results will be buffered if necessary to preserve ordering.
274
- *
275
- * @since 1.18.0
276
- * @category constructors
199
+ * @since 1.20.0
277
200
  */
278
- const mergeBufferConcurrently = exports.mergeBufferConcurrently = core.mergeBufferConcurrently;
201
+ const drain = exports.drain = core.drain;
279
202
  /**
280
- * Merge together multiple Fx into a single Fx that will emit the results of all Fx
281
- * allowing only 1 Fx to run at a time.
282
- *
283
- * @since 1.18.0
284
- * @category constructors
203
+ * @since 1.20.0
285
204
  */
286
- const mergeSwitch = fxs => core.mergeSwitch(fxs);
205
+ const reduce = exports.reduce = /*#__PURE__*/(0, _Function.dual)(3, core.reduce);
287
206
  /**
288
- * Merge together multiple Fx into a single Fx that will emit the results of the
289
- * first Fx to emit a value.
290
- *
291
- * @since 1.18.0
292
- * @category constructors
207
+ * @since 1.20.0
293
208
  */
294
- exports.mergeSwitch = mergeSwitch;
295
- const race = exports.race = core.race;
209
+ const toReadonlyArray = exports.toReadonlyArray = core.toReadonlyArray;
296
210
  /**
297
- * Schedule an Effect to run using the provided Schedule, emitting its success of failure
298
- * at the intervals specified by the Schedule.
299
- *
300
- * @since 1.18.0
301
- * @category constructors
211
+ * @since 1.20.0
302
212
  */
303
- const fromScheduled = exports.fromScheduled = core.fromScheduled;
213
+ const slice = exports.slice = /*#__PURE__*/(0, _Function.dual)(3, core.slice);
304
214
  /**
305
- * Schedule an Effect to run at the specified duration.
306
- *
307
- * @since 1.18.0
308
- * @category constructors
215
+ * @since 1.20.0
309
216
  */
310
- const periodic = exports.periodic = core.periodic;
217
+ const take = exports.take = /*#__PURE__*/(0, _Function.dual)(2, core.take);
311
218
  /**
312
- * Consume a Dequeue as soon as values become available and emit them as a Fx.
313
- * @since 1.18.0
314
- * @category constructors
219
+ * @since 1.20.0
315
220
  */
316
- const fromDequeue = exports.fromDequeue = internal.fromDequeue;
221
+ const drop = exports.drop = /*#__PURE__*/(0, _Function.dual)(2, core.drop);
317
222
  /**
318
- * Consume a PubSub as soon as values become available and emit them as a Fx.
319
- * @since 1.18.0
320
- * @category constructors
223
+ * @since 1.20.0
321
224
  */
322
- const fromPubSub = exports.fromPubSub = internal.fromPubSub;
323
- /* #endregion */
324
- /* #region Running */
225
+ const skipRepeats = exports.skipRepeats = core.skipRepeats;
325
226
  /**
326
- * Run an Fx to completion with the provided Sink. The
327
- * Effect will resolve with the first Error of the Fx.
328
- * @since 1.18.0
329
- * @category running
227
+ * @since 1.20.0
330
228
  */
331
- const run = exports.run = /*#__PURE__*/(0, _Function.dual)(2, internalRun.run);
229
+ const skipRepeatsWith = exports.skipRepeatsWith = /*#__PURE__*/(0, _Function.dual)(2, core.skipRepeatsWith);
332
230
  /**
333
- * Observe an Fx with the provided success value handler. The
334
- * Effect will resolve with the first Error of the Fx.
335
- *
336
- * @since 1.18.0
337
- * @category running
231
+ * @since 1.20.0
338
232
  */
339
- const observe = exports.observe = /*#__PURE__*/(0, _Function.dual)(2, core.observe);
233
+ const empty = exports.empty = core.empty;
340
234
  /**
341
- * Run an Fx to completion. The Effect will resolve with the first Error of the Fx.
342
- *
343
- * @since 1.18.0
344
- * @category running
235
+ * @since 1.20.0
345
236
  */
346
- const drain = exports.drain = core.drain;
237
+ const never = exports.never = core.never;
347
238
  /**
348
- * Reduce an Fx to a single value.
349
- * @since 1.18.0
350
- * @category running
239
+ * @since 1.20.0
351
240
  */
352
- const reduce = exports.reduce = core.reduce;
241
+ const padWith = exports.padWith = /*#__PURE__*/(0, _Function.dual)(3, core.padWith);
353
242
  /**
354
- * Run an Fx to completion, collecting all emitted values into an Array.
355
- * @since 1.18.0
356
- * @category running
243
+ * @since 1.20.0
357
244
  */
358
- const toArray = exports.toArray = core.toArray;
245
+ const prependAll = exports.prependAll = /*#__PURE__*/(0, _Function.dual)(2, core.prependAll);
359
246
  /**
360
- * Run an Fx to completion, collecting all emitted values into a ReadonlyArray.
361
- * @since 1.18.0
362
- * @category running
247
+ * @since 1.20.0
363
248
  */
364
- const toReadonlyArray = exports.toReadonlyArray = core.toReadonlyArray;
249
+ const appendAll = exports.appendAll = /*#__PURE__*/(0, _Function.dual)(2, core.appendAll);
365
250
  /**
366
- * Run an Fx to completion, collecting all emitted values into a Chunk.
367
- * @since 1.18.0
368
- * @category running
251
+ * @since 1.20.0
369
252
  */
370
- const toChunk = exports.toChunk = core.toChunk;
253
+ const prepend = exports.prepend = /*#__PURE__*/(0, _Function.dual)(2, core.prepend);
371
254
  /**
372
- * Consume an Fx and place its values into an Enqueue.
373
- * @since 1.18.0
374
- * @category running
255
+ * @since 1.20.0
375
256
  */
376
- const toEnqueue = exports.toEnqueue = internal.toEnqueue;
377
- /* #endregion */
378
- /* #region Combinators */
257
+ const append = exports.append = /*#__PURE__*/(0, _Function.dual)(2, core.append);
379
258
  /**
380
- * Map over the success value of an Fx.
381
- * @since 1.18.0
382
- * @category combinators
259
+ * @since 1.20.0
383
260
  */
384
- const map = exports.map = core.map;
261
+ const scan = exports.scan = /*#__PURE__*/(0, _Function.dual)(3, core.scan);
385
262
  /**
386
- * Map over both failure and success values of an Fx.
387
- * @since 1.18.0
388
- * @category combinators
263
+ * @since 1.20.0
389
264
  */
390
- const mapBoth = exports.mapBoth = core.mapBoth;
265
+ const flatMapWithStrategy = exports.flatMapWithStrategy = /*#__PURE__*/(0, _Function.dual)(4, core.flatMapWithStrategy);
266
+ const isDataFirstFx = args => isFx(args[0]);
391
267
  /**
392
- * Filter the success value of an Fx.
393
- * @since 1.18.0
394
- * @category combinators
268
+ * @since 1.20.0
395
269
  */
396
- const filter = exports.filter = core.filter;
270
+ const flatMap = exports.flatMap = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMap);
397
271
  /**
398
- * Filter and map the success value of an Fx.
399
- * @since 1.18.0
400
- * @category combinators
272
+ * @since 1.20.0
401
273
  */
402
- const filterMap = exports.filterMap = core.filterMap;
274
+ const flatMapEffect = exports.flatMapEffect = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapEffect);
403
275
  /**
404
- * Unwrap Options by filtering any None values.
405
- * @since 1.18.0
406
- * @category combinators
276
+ * @since 1.20.0
407
277
  */
408
- const compact = exports.compact = core.compact;
278
+ const switchMap = exports.switchMap = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.switchMap);
409
279
  /**
410
- * Map over the Cause of an Fx.
411
- * @since 1.18.0
412
- * @category errors
280
+ * @since 1.20.0
413
281
  */
414
- const mapErrorCause = exports.mapErrorCause = core.mapErrorCause;
282
+ const switchMapEffect = exports.switchMapEffect = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.switchMapEffect);
415
283
  /**
416
- * Map over the Error of an Fx.
417
- * @since 1.18.0
418
- * @category errors
284
+ * @since 1.20.0
419
285
  */
420
- const mapError = exports.mapError = core.mapError;
286
+ const exhaustMap = exports.exhaustMap = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMap);
421
287
  /**
422
- * Filter the Cause of an Fx.
423
- * @since 1.18.0
424
- * @category errors
288
+ * @since 1.20.0
425
289
  */
426
- const filterErrorCause = exports.filterErrorCause = core.filterCause;
290
+ const exhaustMapEffect = exports.exhaustMapEffect = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMapEffect);
427
291
  /**
428
- * Filter and map the Cause of an Fx.
429
- * @since 1.18.0
430
- * @category errors
292
+ * @since 1.20.0
431
293
  */
432
- const filterMapCause = exports.filterMapCause = core.filterMapCause;
294
+ const exhaustMapLatest = exports.exhaustMapLatest = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMapLatest);
433
295
  /**
434
- * Filter the Error of an Fx.
435
- * @since 1.18.0
436
- * @category errors
296
+ * @since 1.20.0
437
297
  */
438
- const filterError = exports.filterError = core.filterError;
298
+ const exhaustMapLatestEffect = exports.exhaustMapLatestEffect = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMapLatestEffect);
439
299
  /**
440
- * Filter and map the error of an Fx.
441
- * @since 1.18.0
442
- * @category errors
300
+ * @since 1.20.0
443
301
  */
444
- const filterMapError = exports.filterMapError = core.filterMapError;
302
+ const flatMapConcurrently = exports.flatMapConcurrently = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapConcurrently);
445
303
  /**
446
- * Filter and map the error of an Fx using an Effect.
447
- * @since 1.18.0
448
- * @category errors
304
+ * @since 1.20.0
449
305
  */
450
- const filterMapErrorEffect = exports.filterMapErrorEffect = core.filterMapErrorEffect;
306
+ const flatMapConcurrentlyEffect = exports.flatMapConcurrentlyEffect = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapConcurrentlyEffect);
451
307
  /**
452
- * Map the success value of an Fx to another Fx, flattening the result
453
- * with the provided FlattenStrategy.
454
- * @since 1.18.0
455
- * @category flattening
308
+ * @since 1.20.0
456
309
  */
457
- const flatMapWithStrategy = exports.flatMapWithStrategy = /*#__PURE__*/(0, _Function.dual)(3, core.flatMapWithStrategy);
310
+ const concatMap = exports.concatMap = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.concatMap);
458
311
  /**
459
- * Map the success value of an Fx to another Fx, switching to the latest
460
- * Fx emitted and interrupting the previous.
461
- * @since 1.18.0
462
- * @category flattening
312
+ * @since 1.20.0
463
313
  */
464
- const switchMap = exports.switchMap = core.switchMap;
314
+ const fromFxEffect = exports.fromFxEffect = core.fromFxEffect;
465
315
  /**
466
- * Map the success value of an Fx to another Fx, switching to the latest
467
- * Fx emitted and interrupting the previous.
468
- * @since 1.18.0
469
- * @category flattening
316
+ * @since 1.20.0
470
317
  */
471
- const switchLatest = exports.switchLatest = /*#__PURE__*/core.switchMap(x => x);
318
+ const continueWith = exports.continueWith = /*#__PURE__*/(0, _Function.dual)(2, core.continueWith);
472
319
  /**
473
- * Map the success value of an Fx to another Fx, prefering the first
474
- * Fx emitted and dropping any subsequent Fx until it has completed.
475
- * @since 1.18.0
476
- * @category flattening
320
+ * @since 1.20.0
477
321
  */
478
- const exhaustMap = exports.exhaustMap = core.exhaustMap;
322
+ const orElseCause = exports.orElseCause = /*#__PURE__*/(0, _Function.dual)(2, core.orElseCause);
479
323
  /**
480
- * Flatten a nested Fx, prefering the first
481
- * Fx emitted and dropping any subsequent Fx until it has completed.
482
- * @since 1.18.0
483
- * @category flattening
324
+ * @since 1.20.0
484
325
  */
485
- const exhaust = exports.exhaust = core.exhaust;
326
+ const orElse = exports.orElse = /*#__PURE__*/(0, _Function.dual)(2, core.orElse);
486
327
  /**
487
- * Map the success value of an Fx to another Fx, prefering the first
488
- * until completion, and then running the last emitted Fx if they are not
489
- * the same Fx.
490
- *
491
- * @since 1.18.0
492
- * @category flattening
328
+ * @since 1.20.0
493
329
  */
494
- const exhaustMapLatest = exports.exhaustMapLatest = core.exhaustMapLatest;
330
+ const suspend = exports.suspend = core.suspend;
495
331
  /**
496
- * Flatten a nested Fx, prefering the first until completion, and then running the last emitted Fx if they are not
497
- * the same Fx.
498
- *
499
- * @since 1.18.0
500
- * @category flattening
332
+ * @since 1.20.0
501
333
  */
502
- const exhaustLatest = exports.exhaustLatest = core.exhaustLatest;
334
+ const mergeWithStrategy = exports.mergeWithStrategy = /*#__PURE__*/(0, _Function.dual)(2, core.mergeWithStrategy);
503
335
  /**
504
- * Map the success value of an Fx to another Fx with unbounded concurrency.
505
- *
506
- * @since 1.18.0
507
- * @category flattening
336
+ * @since 1.20.0
508
337
  */
509
- const flatMap = exports.flatMap = core.flatMap;
338
+ const merge = exports.merge = /*#__PURE__*/(0, _Function.dual)(2, core.merge);
510
339
  /**
511
- * Map the success value of an Fx to another Fx with unbounded concurrency.
512
- *
513
- * @since 1.18.0
514
- * @category flattening
340
+ * @since 1.20.0
515
341
  */
516
- const flatten = exports.flatten = core.flatten;
342
+ const mergeAll = exports.mergeAll = core.mergeAll;
517
343
  /**
518
- * Map the success value of an Fx to another Fx with the specified concurrency.
519
- *
520
- * @since 1.18.0
521
- * @category flattening
344
+ * @since 1.20.0
522
345
  */
523
- const flatMapConcurrently = exports.flatMapConcurrently = core.flatMapConcurrently;
346
+ const mergeOrdered = exports.mergeOrdered = core.mergeOrdered;
524
347
  /**
525
- * Map the success value of an Fx to another Fx one at a time.
526
- *
527
- * @since 1.18.0
528
- * @category flattening
348
+ * @since 1.20.0
529
349
  */
530
- const concatMap = exports.concatMap = core.concatMap;
350
+ const mergeOrderedConcurrently = exports.mergeOrderedConcurrently = core.mergeOrderedConcurrently;
531
351
  /**
532
- * Skip and take a number of values from an Fx.
533
- *
534
- * @since 1.18.0
535
- * @category slicing
352
+ * @since 1.20.0
536
353
  */
537
- const slice = exports.slice = core.slice;
354
+ const mergeSwitch = exports.mergeSwitch = core.mergeSwitch;
538
355
  /**
539
- * Take a number of values from an Fx.
540
- *
541
- * @since 1.18.0
542
- * @category slicing
356
+ * @since 1.20.0
543
357
  */
544
- const take = exports.take = core.take;
358
+ const takeWhile = exports.takeWhile = /*#__PURE__*/(0, _Function.dual)(2, core.takeWhile);
545
359
  /**
546
- * Drop a number of values from an Fx.
547
- *
548
- * @since 1.18.0
549
- * @category slicing
360
+ * @since 1.20.0
550
361
  */
551
- const drop = exports.drop = core.drop;
362
+ const takeUntil = exports.takeUntil = /*#__PURE__*/(0, _Function.dual)(2, core.takeUntil);
552
363
  /**
553
- * Take values from an Fx while the predicate returns true.
554
- *
555
- * @since 1.18.0
556
- * @category slicing
364
+ * @since 1.20.0
557
365
  */
558
- const takeWhile = exports.takeWhile = core.takeWhile;
366
+ const dropWhile = exports.dropWhile = /*#__PURE__*/(0, _Function.dual)(2, core.dropWhile);
559
367
  /**
560
- * Take values from an Fx until the predicate returns true.
561
- *
562
- * @since 1.18.0
563
- * @category slicing
368
+ * @since 1.20.0
564
369
  */
565
- const takeUntil = exports.takeUntil = core.takeUntil;
370
+ const dropUntil = exports.dropUntil = /*#__PURE__*/(0, _Function.dual)(2, core.dropUntil);
566
371
  /**
567
- * Drop values from an Fx while the predicate returns true.
568
- *
569
- * @since 1.18.0
570
- * @category slicing
372
+ * @since 1.20.0
571
373
  */
572
- const dropWhile = exports.dropWhile = core.dropWhile;
374
+ const dropAfter = exports.dropAfter = /*#__PURE__*/(0, _Function.dual)(2, core.dropAfter);
573
375
  /**
574
- * Drop values from an Fx until the predicate returns true.
575
- *
576
- * @since 1.18.0
577
- * @category slicing
376
+ * @since 1.20.0
578
377
  */
579
- const dropUntil = exports.dropUntil = core.dropUntil;
378
+ const takeWhileEffect = exports.takeWhileEffect = /*#__PURE__*/(0, _Function.dual)(2, core.takeWhileEffect);
580
379
  /**
581
- * Drop values from an Fx after the predicate returns true.
582
- *
583
- * @since 1.18.0
584
- * @category slicing
380
+ * @since 1.20.0
585
381
  */
586
- const dropAfter = exports.dropAfter = core.dropAfter;
382
+ const takeUntiEffect = exports.takeUntiEffect = /*#__PURE__*/(0, _Function.dual)(2, core.takeUntilEffect);
587
383
  /**
588
- * Concatenate an Fx after the successful completion of another Fx
589
- *
590
- * @since 1.18.0
591
- * @category combinators
384
+ * @since 1.20.0
592
385
  */
593
- const continueWith = exports.continueWith = core.continueWith;
386
+ const dropWhileEffect = exports.dropWhileEffect = /*#__PURE__*/(0, _Function.dual)(2, core.dropWhileEffect);
594
387
  /**
595
- * Concatenate an Fx after the failure of another Fx
596
- *
597
- * @since 1.18.0
598
- * @category combinators
388
+ * @since 1.20.0
599
389
  */
600
- const orElse = exports.orElse = core.recoverWith;
390
+ const dropUntilEffect = exports.dropUntilEffect = /*#__PURE__*/(0, _Function.dual)(2, core.dropUntilEffect);
601
391
  /**
602
- * Map the success value of an Fx to an Effect, doesn't fork any fibers like flatMap* etc.
603
- *
604
- * @since 1.18.0
605
- * @category combinators
392
+ * @since 1.20.0
606
393
  */
607
- const mapEffect = exports.mapEffect = core.mapEffect;
394
+ const dropAfterEffect = exports.dropAfterEffect = /*#__PURE__*/(0, _Function.dual)(2, core.dropAfterEffect);
608
395
  /**
609
- * Perform an Effect for each value emitted by an Fx, not affecting the output of the Fx.
610
- *
611
- * @since 1.18.0
612
- * @category combinators
396
+ * @since 1.20.0
613
397
  */
614
- const tap = exports.tap = core.tap;
398
+ const during = exports.during = /*#__PURE__*/(0, _Function.dual)(2, core.during);
615
399
  /**
616
- * Filter the success value of an Fx with an Effect.
617
- *
618
- * @since 1.18.0
619
- * @category combinators
400
+ * @since 1.20.0
620
401
  */
621
- const filterEffect = exports.filterEffect = core.filterEffect;
402
+ const since = exports.since = /*#__PURE__*/(0, _Function.dual)(2, core.since);
622
403
  /**
623
- * Filter and map the success value of an Fx with an Effect.
624
- *
625
- * @since 1.18.0
626
- * @category combinators
404
+ * @since 1.20.0
627
405
  */
628
- const filterMapEffect = exports.filterMapEffect = core.filterMapEffect;
406
+ const until = exports.until = /*#__PURE__*/(0, _Function.dual)(2, core.until);
629
407
  /**
630
- * Apply a function to the constructed Effect that represents the running Fx.
631
- *
632
- * @since 1.18.0
633
- * @category combinators
408
+ * @since 1.20.0
634
409
  */
635
- const middleware = exports.middleware = core.middleware;
410
+ const middleware = exports.middleware = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.middleware);
636
411
  /**
637
- * Accumulate a value over the success values of an Fx and atomically produce derived value.
638
- *
639
- * @since 1.18.0
640
- * @category combinators
412
+ * @since 1.20.0
641
413
  */
642
- const loop = exports.loop = core.loop;
414
+ const onExit = exports.onExit = /*#__PURE__*/(0, _Function.dual)(2, core.onExit);
643
415
  /**
644
- * Emit values with their previously emitted values when possible.
645
- *
646
- * @since 1.18.0
647
- * @category combinators
416
+ * @since 1.20.0
648
417
  */
649
- const withPrevious = fx => loop(fx, Option.none(), (previous, current) => [[previous, current], Option.some(current)]);
418
+ const onInterrupt = exports.onInterrupt = /*#__PURE__*/(0, _Function.dual)(2, core.onInterrupt);
650
419
  /**
651
- * Accumulate a value over the success values of an Fx and atomically produce derived value
652
- * useing an Effect. A SynchronizedRef is utilized to ensure ordering of events.
653
- *
654
- * @since 1.18.0
655
- * @category combinators
420
+ * @since 1.20.0
656
421
  */
657
- exports.withPrevious = withPrevious;
658
- const loopEffect = exports.loopEffect = core.loopEffect;
422
+ const onError = exports.onError = /*#__PURE__*/(0, _Function.dual)(2, core.onError);
659
423
  /**
660
- * Prepends a value to the beginning of an Fx.
661
- *
662
- * @since 1.18.0
663
- * @category combinators
424
+ * @since 1.20.0
664
425
  */
665
- const startWith = exports.startWith = core.startWith;
426
+ const scoped = exports.scoped = core.scoped;
666
427
  /**
667
- * Appends a value to the end of an Fx.
668
- *
669
- * @since 1.18.0
670
- * @category combinators
428
+ * @since 1.20.0
671
429
  */
672
- const endWith = exports.endWith = core.endWith;
430
+ const annotateLogs = exports.annotateLogs = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.annotateLogs);
673
431
  /**
674
- * Run a reducer over the success values of an Fx.
675
- *
676
- * @since 1.18.0
677
- * @category combinators
432
+ * @since 1.20.0
678
433
  */
679
- const scan = exports.scan = core.scan;
434
+ const annotateSpans = exports.annotateSpans = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.annotateSpans);
680
435
  /**
681
- * Run an Effect-ful reducer over the success values of an Fx.
682
- *
683
- * @since 1.18.0
684
- * @category combinators
436
+ * @since 1.20.0
685
437
  */
686
- const scanEffect = exports.scanEffect = core.scanEffect;
438
+ const interruptible = exports.interruptible = core.interruptible;
687
439
  /**
688
- * Map the failures of an Fx to another Fx, flattening the result
689
- * with the provided FlattenStrategy.
690
- * @since 1.18.0
691
- * @category flattening
440
+ * @since 1.20.0
692
441
  */
693
- const flatMapCauseWithStrategy = exports.flatMapCauseWithStrategy = core.flatMapCauseWithStrategy;
442
+ const uninterruptible = exports.uninterruptible = core.uninterruptible;
694
443
  /**
695
- * Map the failures of an Fx to another Fx, flattening the result
696
- * with the provided FlattenStrategy.
697
- * @since 1.18.0
698
- * @category flattening
444
+ * @since 1.20.0
699
445
  */
700
- const flatMapErrorWithStrategy = exports.flatMapErrorWithStrategy = core.flatMapErrorWithStrategy;
446
+ const locally = exports.locally = /*#__PURE__*/(0, _Function.dual)(3, core.locally);
701
447
  /**
702
- * Map the failures of an Fx to another Fx, flattening the result with unbounded concurrency.
703
- *
704
- * @since 1.18.0
705
- * @category flattening
448
+ * @since 1.20.0
706
449
  */
707
- const flatMapCause = exports.flatMapCause = core.flatMapCause;
450
+ const locallyWith = exports.locallyWith = /*#__PURE__*/(0, _Function.dual)(3, core.locallyWith);
708
451
  /**
709
- * Map the failures of an Fx to another Fx, flattening the result with unbounded concurrency.
710
- *
711
- * @since 1.18.0
712
- * @category flattening
452
+ * @since 1.20.0
713
453
  */
714
- const flatMapError = exports.flatMapError = core.flatMapError;
454
+ const withTracerTiming = exports.withTracerTiming = /*#__PURE__*/(0, _Function.dual)(2, core.withTracerTiming);
715
455
  /**
716
- * Map the failures of an Fx to another Fx with the specified concurrency.
717
- *
718
- * @since 1.18.0
719
- * @category flattening
456
+ * @since 1.20.0
720
457
  */
721
- const flatMapCauseConcurrently = exports.flatMapCauseConcurrently = core.flatMapCauseConcurrently;
458
+ const withConcurrency = exports.withConcurrency = /*#__PURE__*/(0, _Function.dual)(2, core.withConcurrency);
722
459
  /**
723
- * Map the failures of an Fx to another Fx with the specified concurrency.
724
- *
725
- * @since 1.18.0
726
- * @category flattening
460
+ * @since 1.20.0
727
461
  */
728
- const flatMapErrorConcurrently = exports.flatMapErrorConcurrently = core.flatMapErrorConcurrently;
462
+ const withConfigProvider = exports.withConfigProvider = /*#__PURE__*/(0, _Function.dual)(2, core.withConfigProvider);
729
463
  /**
730
- * Map the failures of an Fx to another Fx, switching to the latest
731
- * Fx emitted and interrupting the previous.
732
- *
733
- * @since 1.18.0
734
- * @category flattening
464
+ * @since 1.20.0
735
465
  */
736
- const switchMapCause = exports.switchMapCause = core.switchMapCause;
466
+ const withLogSpan = exports.withLogSpan = /*#__PURE__*/(0, _Function.dual)(2, core.withLogSpan);
737
467
  /**
738
- * Map the failures of an Fx to another Fx, switching to the latest
739
- * Fx emitted and interrupting the previous.
740
- *
741
- * @since 1.18.0
742
- * @category flattening
468
+ * @since 1.20.0
743
469
  */
744
- const switchMapError = exports.switchMapError = core.switchMapError;
470
+ const withMaxOpsBeforeYield = exports.withMaxOpsBeforeYield = /*#__PURE__*/(0, _Function.dual)(2, core.withMaxOpsBeforeYield);
745
471
  /**
746
- * Map the failures of an Fx to another Fx, prefering the first
747
- * Fx emitted and dropping any subsequent Fx until it has completed.
748
- *
749
- * @since 1.18.0
750
- * @category flattening
472
+ * @since 1.20.0
751
473
  */
752
- const exhaustMapCause = exports.exhaustMapCause = core.exhaustMapCause;
474
+ const withParentSpan = exports.withParentSpan = /*#__PURE__*/(0, _Function.dual)(2, core.withParentSpan);
753
475
  /**
754
- * Map the failures of an Fx to another Fx, prefering the first
755
- * Fx emitted and dropping any subsequent Fx until it has completed.
756
- *
757
- * @since 1.18.0
758
- * @category flattening
476
+ * @since 1.20.0
759
477
  */
760
- const exhaustMapError = exports.exhaustMapError = core.exhaustMapError;
478
+ const withRequestBatching = exports.withRequestBatching = /*#__PURE__*/(0, _Function.dual)(2, core.withRequestBatching);
761
479
  /**
762
- * Map the failures of an Fx to another Fx, prefering the first
763
- * until completion, and then running the last emitted Fx if they are not
764
- * the same Fx.
765
- *
766
- * @since 1.18.0
767
- * @category flattening
480
+ * @since 1.20.0
768
481
  */
769
- const exhaustMapLatestCause = exports.exhaustMapLatestCause = core.exhaustMapLatestCause;
482
+ const withRequestCache = exports.withRequestCache = /*#__PURE__*/(0, _Function.dual)(2, core.withRequestCache);
770
483
  /**
771
- * Map the failures of an Fx to another Fx, prefering the first
772
- * until completion, and then running the last emitted Fx if they are not
773
- * the same Fx.
774
- *
775
- * @since 1.18.0
776
- * @category flattening
484
+ * @since 1.20.0
777
485
  */
778
- const exhaustMapLatestError = exports.exhaustMapLatestError = core.exhaustMapLatestError;
486
+ const withRequestCaching = exports.withRequestCaching = /*#__PURE__*/(0, _Function.dual)(2, core.withRequestCaching);
779
487
  /**
780
- * Map over the failures and successes of an Fx, flattening both using the same strategy.
781
- *
782
- * @since 1.18.0
783
- * @category flattening
488
+ * @since 1.20.0
784
489
  */
785
- const matchCauseWithStrategy = exports.matchCauseWithStrategy = core.matchCauseWithStrategy;
490
+ const withTracer = exports.withTracer = /*#__PURE__*/(0, _Function.dual)(2, core.withTracer);
786
491
  /**
787
- * Map over the failures and successes of an Fx, flattening both using the same strategy.
788
- *
789
- * @since 1.18.0
790
- * @category flattening
492
+ * @since 1.20.0
791
493
  */
792
- const matchErrorWithStrategy = exports.matchErrorWithStrategy = core.matchErrorWithStrategy;
494
+ const acquireUseRelease = exports.acquireUseRelease = /*#__PURE__*/(0, _Function.dual)(3, core.acquireUseRelease);
793
495
  /**
794
- * Map over the failures and successes of an Fx, flattening both with unbounded concurrency.
795
- *
796
- * @since 1.18.0
797
- * @category flattening
496
+ * @since 1.20.0
798
497
  */
799
- const matchCause = exports.matchCause = core.matchCause;
498
+ const withSpan = exports.withSpan = /*#__PURE__*/(0, _Function.dual)(3, core.withSpan);
800
499
  /**
801
- * Map over the failures and successes of an Fx, flattening both with unbounded concurrency.
802
- *
803
- * @since 1.18.0
804
- * @category flattening
500
+ * @since 1.20.0
805
501
  */
806
- const match = exports.match = core.match;
502
+ const provideContext = exports.provideContext = /*#__PURE__*/(0, _Function.dual)(2, core.provideContext);
807
503
  /**
808
- * Map over the failures and successes of an Fx, flattening both with the specified concurrency.
809
- *
810
- * @since 1.18.0
811
- * @category flattening
504
+ * @since 1.20.0
812
505
  */
813
- const matchCauseConcurrently = exports.matchCauseConcurrently = core.matchCauseConcurrently;
506
+ const provideLayer = exports.provideLayer = /*#__PURE__*/(0, _Function.dual)(2, core.provideLayer);
814
507
  /**
815
- * Map over the failures and successes of an Fx, flattening both with the specified concurrency.
816
- *
817
- * @since 1.18.0
818
- * @category flattening
508
+ * @since 1.20.0
819
509
  */
820
- const matchErrorConcurrently = exports.matchErrorConcurrently = core.matchErrorConcurrently;
510
+ const provideRuntime = exports.provideRuntime = /*#__PURE__*/(0, _Function.dual)(2, core.provideRuntime);
821
511
  /**
822
- * Map over the failures and successes of an Fx, switching to the latest
823
- * Fx emitted and interrupting the previous.
824
- *
825
- * @since 1.18.0
826
- * @category flattening
512
+ * @since 1.20.0
827
513
  */
828
- const switchMatchCause = exports.switchMatchCause = core.switchMatchCause;
514
+ const provideService = exports.provideService = /*#__PURE__*/(0, _Function.dual)(3, core.provideService);
829
515
  /**
830
- * Map over the failures and successes of an Fx, switching to the latest
831
- * Fx emitted and interrupting the previous.
832
- *
833
- * @since 1.18.0
834
- * @category flattening
516
+ * @since 1.20.0
835
517
  */
836
- const switchMatch = exports.switchMatch = core.switchMatch;
518
+ const provideServiceEffect = exports.provideServiceEffect = /*#__PURE__*/(0, _Function.dual)(3, core.provideServiceEffect);
837
519
  /**
838
- * Map over the failures and successes of an Fx, prefering the first
839
- * Fx emitted and dropping any subsequent Fx until it has completed.
840
- *
841
- * @since 1.18.0
842
- * @category flattening
520
+ * @since 1.20.0
843
521
  */
844
- const exhaustMatchCause = exports.exhaustMatchCause = core.exhaustMatchCause;
522
+ const provide = exports.provide = /*#__PURE__*/(0, _Function.dual)(2, core.provide);
845
523
  /**
846
- * Map over the failures and successes of an Fx, prefering the first
847
- * Fx emitted and dropping any subsequent Fx until it has completed.
848
- *
849
- * @since 1.18.0
850
- * @category flattening
524
+ * @since 1.20.0
851
525
  */
852
- const exhaustMatch = exports.exhaustMatch = core.exhaustMatch;
526
+ const share = exports.share = /*#__PURE__*/(0, _Function.dual)(2, coreShare.share);
853
527
  /**
854
- * Map over the failures and successes of an Fx, prefering the first
855
- * Fx emitted and starting the latest Fx when the first completes
856
- * if they are not the same Fx.
857
- *
858
- * @since 1.18.0
859
- * @category flattening
528
+ * @since 1.20.0
860
529
  */
861
- const exhaustLatestMatchCause = exports.exhaustLatestMatchCause = core.exhaustLatestMatchCause;
530
+ const multicast = exports.multicast = coreShare.multicast;
862
531
  /**
863
- * Map over the failures and successes of an Fx, prefering the first
864
- * Fx emitted and starting the latest Fx when the first completes
865
- * if they are not the same Fx.
866
- *
867
- * @since 1.18.0
868
- * @category flattening
532
+ * @since 1.20.0
869
533
  */
870
- const exhaustLatestMatch = exports.exhaustLatestMatch = core.exhaustLatestMatch;
534
+ const hold = exports.hold = coreShare.hold;
871
535
  /**
872
- * Listen to the events of an Fx within the provided window. When the window Fx
873
- * emits the inner stream, the fx will begin allowing events to pass through,
874
- * and when the inner stream emits, the fx will be interrupted.
875
- *
876
- * @since 1.18.0
877
- * @category time slicing
536
+ * @since 1.20.0
878
537
  */
879
- const during = exports.during = core.during;
538
+ const replay = exports.replay = /*#__PURE__*/(0, _Function.dual)(2, coreShare.replay);
880
539
  /**
881
- * Listen to the events of an Fx after the provided window emits.
882
- *
883
- * @since 1.18.0
884
- * @category time slicing
540
+ * @since 1.20.0
885
541
  */
886
- const since = exports.since = core.since;
542
+ const mapCause = exports.mapCause = /*#__PURE__*/(0, _Function.dual)(2, core.mapCause);
887
543
  /**
888
- * Listen to the events of an Fx until the provided window emits.
889
- *
890
- * @since 1.18.0
891
- * @category time slicing
544
+ * @since 1.20.0
892
545
  */
893
- const until = exports.until = core.until;
546
+ const mapError = exports.mapError = /*#__PURE__*/(0, _Function.dual)(2, core.mapError);
894
547
  /**
895
- * Provide the environment to an Fx.
896
- *
897
- * @since 1.18.0
898
- * @category context
548
+ * @since 1.20.0
899
549
  */
900
- const provide = exports.provide = core.provide;
550
+ const mapBoth = exports.mapBoth = /*#__PURE__*/(0, _Function.dual)(3, core.mapBoth);
901
551
  /**
902
- * Provide a service to an Fx using a Tag.
903
- * @since 1.18.0
904
- * @category context
552
+ * @since 1.20.0
905
553
  */
906
- const provideService = exports.provideService = core.provideService;
554
+ const filterCause = exports.filterCause = /*#__PURE__*/(0, _Function.dual)(2, core.filterCause);
907
555
  /**
908
- * Provide a service using an Effect to an Fx using a Tag.
909
- *
910
- * @since 1.18.0
911
- * @category context
556
+ * @since 1.20.0
912
557
  */
913
- const provideServiceEffect = exports.provideServiceEffect = core.provideServiceEffect;
558
+ const filterError = exports.filterError = /*#__PURE__*/(0, _Function.dual)(2, core.filterError);
914
559
  /**
915
- * Skip repeated values, using the provided Equivalence to compare values.
916
- *
917
- * @since 1.18.0
918
- * @category slicing
560
+ * @since 1.20.0
919
561
  */
920
- const skipRepeatsWith = exports.skipRepeatsWith = core.skipRepeatsWith;
562
+ const filterMapCause = exports.filterMapCause = /*#__PURE__*/(0, _Function.dual)(2, core.filterMapCause);
921
563
  /**
922
- * Skip repeated values, using @effect/data/Equal for value comparison.
923
- *
924
- * @since 1.18.0
925
- * @category slicing
564
+ * @since 1.20.0
926
565
  */
927
- const skipRepeats = exports.skipRepeats = core.skipRepeats;
566
+ const filterMapError = exports.filterMapError = /*#__PURE__*/(0, _Function.dual)(2, core.filterMapError);
928
567
  /**
929
- * Sample the values of an Fx, or Effect, during the events of another Fx.
930
- *
931
- * @since 1.18.0
932
- * @category combinators
568
+ * @since 1.20.0
933
569
  */
934
- const snapshot = exports.snapshot = core.snapshot;
570
+ const mapCauseEffect = exports.mapCauseEffect = /*#__PURE__*/(0, _Function.dual)(2, core.mapCauseEffect);
935
571
  /**
936
- * Share the output of an Fx, or Effect, with other Fx's using the behavior of the
937
- * provided Subject.
938
- *
939
- * @since 1.18.0
940
- * @category sharing
572
+ * @since 1.20.0
941
573
  */
942
- const share = exports.share = Share.share;
574
+ const mapErrorEffect = exports.mapErrorEffect = /*#__PURE__*/(0, _Function.dual)(2, core.mapErrorEffect);
943
575
  /**
944
- * Effeciently share an underlying stream with multiple subscribers.
945
- *
946
- * @since 1.18.0
947
- * @category sharing
576
+ * @since 1.20.0
948
577
  */
949
- const multicast = exports.multicast = Share.multicast;
578
+ const filterCauseEffect = exports.filterCauseEffect = /*#__PURE__*/(0, _Function.dual)(2, core.filterCauseEffect);
950
579
  /**
951
- * Effeciently share an underlying stream with multiple subscribers, saving the most
952
- * recent event and emitting it to new subscribers.
953
- *
954
- * @since 1.18.0
955
- * @category sharing
580
+ * @since 1.20.0
956
581
  */
957
- const hold = exports.hold = Share.hold;
582
+ const filterErrorEffect = exports.filterErrorEffect = /*#__PURE__*/(0, _Function.dual)(2, core.filterErrorEffect);
958
583
  /**
959
- * Effeciently share an underlying stream with multiple subscribers,
960
- * saving up to the most recent `n` events and emitting them to new subscribers.
961
- *
962
- * @since 1.18.0
963
- * @category sharing
584
+ * @since 1.20.0
964
585
  */
965
- const replay = exports.replay = Share.replay;
586
+ const filterMapCauseEffect = exports.filterMapCauseEffect = /*#__PURE__*/(0, _Function.dual)(2, core.filterMapCauseEffect);
966
587
  /**
967
- * Create an Fx which will wait a specified duration of time where no
968
- * events have occurred before emitting a value.
969
- * @since 1.18.0
970
- * @category time slicing
588
+ * @since 1.20.0
971
589
  */
972
- const debounce = exports.debounce = internal.debounce;
590
+ const filterMapErrorEffect = exports.filterMapErrorEffect = /*#__PURE__*/(0, _Function.dual)(2, core.filterMapErrorEffect);
973
591
  /**
974
- * Create an Fx which will wait a specified duration of time before emitting
975
- * an event after the last event.
976
- * @since 1.18.0
977
- * @category time slicing
592
+ * @since 1.20.0
978
593
  */
979
- const throttle = exports.throttle = internal.throttle;
594
+ const loopCause = exports.loopCause = /*#__PURE__*/(0, _Function.dual)(3, core.loopCause);
980
595
  /**
981
- * Create an Fx which will wait a specified duration of time where no
982
- * events have occurred before emitting a value.
983
- * @since 1.18.0
984
- * @category combinators
596
+ * @since 1.20.0
985
597
  */
986
- const delay = exports.delay = internal.delay;
598
+ const loopError = exports.loopError = /*#__PURE__*/(0, _Function.dual)(3, core.loopError);
987
599
  /**
988
- * Run an Effect to produce an Fx to run.
989
- * @since 1.18.0
990
- * @category constructors
600
+ * @since 1.20.0
991
601
  */
992
- const fromFxEffect = exports.fromFxEffect = internal.fromFxEffect;
602
+ const loopCauseEffect = exports.loopCauseEffect = /*#__PURE__*/(0, _Function.dual)(3, core.loopCauseEffect);
993
603
  /**
994
- * Utilize Effect.gen to construct an Fx
995
- * @since 1.18.0
996
- * @category constructors
604
+ * @since 1.20.0
997
605
  */
998
- function gen(f) {
999
- return fromFxEffect(Effect.gen(f));
1000
- }
606
+ const loopErrorEffect = exports.loopErrorEffect = /*#__PURE__*/(0, _Function.dual)(3, core.loopErrorEffect);
1001
607
  /**
1002
- * Utilize Effect.gen to construct an Fx
1003
- * @since 1.18.0
1004
- * @category constructors
608
+ * @since 1.20.0
1005
609
  */
1006
- function genScoped(f) {
1007
- return scoped(fromFxEffect(Effect.gen(f)));
1008
- }
610
+ const filterMapLoopCause = exports.filterMapLoopCause = /*#__PURE__*/(0, _Function.dual)(3, core.filterMapLoopCause);
1009
611
  /**
1010
- * Run an Effect when an Fx exits
1011
- * @since 1.18.0
1012
- * @category lifecycles
612
+ * @since 1.20.0
1013
613
  */
1014
- const onExit = exports.onExit = internal.onExit;
614
+ const filterMapLoopError = exports.filterMapLoopError = /*#__PURE__*/(0, _Function.dual)(3, core.filterMapLoopError);
1015
615
  /**
1016
- * Run an Effect when an Fx is interrupted
1017
- * @since 1.18.0
1018
- * @category lifecycles
616
+ * @since 1.20.0
1019
617
  */
1020
- const onInterrupt = exports.onInterrupt = internal.onInterrupt;
618
+ const filterMapLoopCauseEffect = exports.filterMapLoopCauseEffect = /*#__PURE__*/(0, _Function.dual)(3, core.filterMapLoopCauseEffect);
1021
619
  /**
1022
- * Run an Effect when an Fx ends with an error
1023
- * @since 1.18.0
1024
- * @category lifecycles
620
+ * @since 1.20.0
1025
621
  */
1026
- const onError = exports.onError = internal.onError;
622
+ const filterMapLoopErrorEffect = exports.filterMapLoopErrorEffect = /*#__PURE__*/(0, _Function.dual)(3, core.filterMapLoopErrorEffect);
1027
623
  /**
1028
- * Provide a Scope to an Fx
1029
- * @since 1.18.0
1030
- * @category context
624
+ * @since 1.20.0
1031
625
  */
1032
- const scoped = exports.scoped = internal.scoped;
626
+ const flatMapCauseWithStrategy = exports.flatMapCauseWithStrategy = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapCauseWithStrategy);
1033
627
  /**
1034
- * Annotate the logs of an Fx
1035
- * @since 1.18.0
1036
- * @category combinators
628
+ * @since 1.20.0
1037
629
  */
1038
- const annotateLogs = exports.annotateLogs = internal.annotateLogs;
630
+ const flatMapErrorWithStrategy = exports.flatMapErrorWithStrategy = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapErrorWithStrategy);
1039
631
  /**
1040
- * Annotate the spans of an Fx
1041
- * @since 1.18.0
1042
- * @category combinators
632
+ * @since 1.20.0
1043
633
  */
1044
- const annotateSpans = exports.annotateSpans = internal.annotateSpans;
634
+ const switchMapCause = exports.switchMapCause = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.switchMapCause);
1045
635
  /**
1046
- * Create an Fx which will succeed with Option.None
1047
- * @since 1.18.0
1048
- * @category constructors
636
+ * @since 1.20.0
1049
637
  */
1050
- const succeedNone = exports.succeedNone = internal.succeedNone;
638
+ const switchMapError = exports.switchMapError = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.switchMapError);
1051
639
  /**
1052
- * Create an Fx which will succeed with Option.Some
1053
- * @since 1.18.0
1054
- * @category constructors
640
+ * @since 1.20.0
1055
641
  */
1056
- const succeedSome = exports.succeedSome = internal.succeedSome;
642
+ const flatMapCause = exports.flatMapCause = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapCause);
1057
643
  /**
1058
- * Do simulation
1059
- * @since 1.18.0
1060
- * @category Do
644
+ * @since 1.20.0
1061
645
  */
1062
- const Do = exports.Do = internal.Do;
646
+ const flatMapError = exports.flatMapError = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapError);
1063
647
  /**
1064
- * Do simulation
1065
- * @since 1.18.0
1066
- * @category Do
648
+ * @since 1.20.0
1067
649
  */
1068
- const bind = exports.bind = internal.bind;
650
+ const flatMapCauseConcurrently = exports.flatMapCauseConcurrently = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapCauseConcurrently);
1069
651
  /**
1070
- * Do simulation
1071
- * @since 1.18.0
1072
- * @category Do
652
+ * @since 1.20.0
1073
653
  */
1074
- const bindTo = exports.bindTo = internal.bindTo;
1075
- const let_ = exports.let = internal.let;
654
+ const flatMapErrorConcurrently = exports.flatMapErrorConcurrently = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.flatMapErrorConcurrently);
1076
655
  /**
1077
- * Ensure a finalizer runs on Fx ext.
1078
- * @since 1.18.0
1079
- * @category combinators
656
+ * @since 1.20.0
1080
657
  */
1081
- const ensuring = exports.ensuring = internal.ensuring;
658
+ const exhaustMapCause = exports.exhaustMapCause = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMapCause);
1082
659
  /**
1083
- * Capture the errors and success values as Exit
1084
- * @since 1.18.0
1085
- * @category combinators
660
+ * @since 1.20.0
1086
661
  */
1087
- const exit = exports.exit = internal.exit;
662
+ const exhaustMapError = exports.exhaustMapError = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMapError);
1088
663
  /**
1089
- * Capture the errors and success values as Either
1090
- * @since 1.18.0
1091
- * @category combinators
664
+ * @since 1.20.0
1092
665
  */
1093
- const either = exports.either = internal.either;
666
+ const exhaustMapLatestCause = exports.exhaustMapLatestCause = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMapLatestCause);
1094
667
  /**
1095
- * Run an Fx until finding a value which satisfies the predicate.
1096
- * @since 1.18.0
1097
- * @category running
668
+ * @since 1.20.0
1098
669
  */
1099
- const findFirst = exports.findFirst = internal.findFirst;
670
+ const exhaustMapLatestError = exports.exhaustMapLatestError = /*#__PURE__*/(0, _Function.dual)(isDataFirstFx, core.exhaustMapLatestError);
1100
671
  /**
1101
- * Grab the first value emitted by an Fx
1102
- * @since 1.18.0
1103
- * @category running
672
+ * @since 1.20.0
1104
673
  */
1105
- const first = exports.first = /*#__PURE__*/findFirst( /*#__PURE__*/(0, _Function.constant)( /*#__PURE__*/Effect.succeed(true)));
674
+ const matchCauseWithStrategy = exports.matchCauseWithStrategy = /*#__PURE__*/(0, _Function.dual)(3, core.matchCauseWithStrategy);
1106
675
  /**
1107
- * Transform success values into failures and failures into successes.
1108
- * @since 1.18.0
1109
- * @category combinators
676
+ * @since 1.20.0
1110
677
  */
1111
- const flip = exports.flip = internal.flip;
678
+ const matchErrorWithStrategy = exports.matchErrorWithStrategy = /*#__PURE__*/(0, _Function.dual)(3, core.matchErrorWithStrategy);
1112
679
  /**
1113
- * Lift a nullable value into an Fx
1114
- * @since 1.18.0
1115
- * @category constructors
680
+ * @since 1.20.0
1116
681
  */
1117
- const fromNullable = exports.fromNullable = internal.fromNullable;
1118
- const if_ = exports.if = internal.if;
682
+ const matchCause = exports.matchCause = /*#__PURE__*/(0, _Function.dual)(2, core.matchCause);
1119
683
  /**
1120
- * Logical if/else using static values.
1121
- * @since 1.18.0
1122
- * @category combinators
684
+ * @since 1.20.0
1123
685
  */
1124
- const when = exports.when = internal.when;
686
+ const matchError = exports.matchError = /*#__PURE__*/(0, _Function.dual)(2, core.matchError);
1125
687
  /**
1126
- * Mark an Fx as interruptible
1127
- * @since 1.18.0
1128
- * @category combinators
688
+ * @since 1.20.0
1129
689
  */
1130
- const interruptible = exports.interruptible = internal.interruptible;
690
+ const matchCauseConcurrently = exports.matchCauseConcurrently = /*#__PURE__*/(0, _Function.dual)(3, core.matchCauseConcurrently);
1131
691
  /**
1132
- * Mark an Fx as uninterruptible
1133
- * @since 1.18.0
1134
- * @category combinators
692
+ * @since 1.20.0
1135
693
  */
1136
- const uninterruptible = exports.uninterruptible = internal.uninterruptible;
694
+ const matchErrorConcurrently = exports.matchErrorConcurrently = /*#__PURE__*/(0, _Function.dual)(3, core.matchErrorConcurrently);
1137
695
  /**
1138
- * Locally set the value of a FiberRef
1139
- * @since 1.18.0
1140
- * @category FiberRef
696
+ * @since 1.20.0
1141
697
  */
1142
- const locally = exports.locally = internal.locally;
698
+ const switchMatchCause = exports.switchMatchCause = /*#__PURE__*/(0, _Function.dual)(2, core.switchMatchCause);
1143
699
  /**
1144
- * Locally set the value of a FiberRef by updating the current value
1145
- * @since 1.18.0
1146
- * @category FiberRef
700
+ * @since 1.20.0
1147
701
  */
1148
- const locallyWith = exports.locallyWith = internal.locallyWith;
702
+ const switchMatchError = exports.switchMatchError = /*#__PURE__*/(0, _Function.dual)(2, core.switchMatchError);
1149
703
  /**
1150
- * Enable/disable tracer timing for an Fx
1151
- * @since 1.18.0
1152
- * @category tracing
704
+ * @since 1.20.0
1153
705
  */
1154
- const withTracerTiming = exports.withTracerTiming = internal.withTracerTiming;
706
+ const exhaustMatchCause = exports.exhaustMatchCause = /*#__PURE__*/(0, _Function.dual)(2, core.exhaustMatchCause);
1155
707
  /**
1156
- * Configure the concurreny limit of Fibers running within an Fx
1157
- * @since 1.18.0
1158
- * @category concurrency
708
+ * @since 1.20.0
1159
709
  */
1160
- const withConcurrency = exports.withConcurrency = internal.withConcurrency;
710
+ const exhaustMatchError = exports.exhaustMatchError = /*#__PURE__*/(0, _Function.dual)(2, core.exhaustMatchError);
1161
711
  /**
1162
- * Add a span to your log messages
1163
- * @since 1.18.0
1164
- * @category logging
712
+ * @since 1.20.0
1165
713
  */
1166
- const withLogSpan = exports.withLogSpan = internal.withLogSpan;
714
+ const exhaustMatchLatestCause = exports.exhaustMatchLatestCause = /*#__PURE__*/(0, _Function.dual)(2, core.exhaustMatchLatestCause);
1167
715
  /**
1168
- * Configure the maximum number of operations to run before yielding to the runtime
1169
- * @since 1.18.0
1170
- * @category concurrency
716
+ * @since 1.20.0
1171
717
  */
1172
- const withMaxOpsBeforeYield = exports.withMaxOpsBeforeYield = internal.withMaxOpsBeforeYield;
718
+ const exhaustMatchLatestError = exports.exhaustMatchLatestError = /*#__PURE__*/(0, _Function.dual)(2, core.exhaustMatchLatestError);
1173
719
  /**
1174
- * Set the parent Span of an Fx
1175
- * @since 1.18.0
1176
- * @category tracing
720
+ * @since 1.20.0
1177
721
  */
1178
- const withParentSpan = exports.withParentSpan = internal.withParentSpan;
722
+ const exit = exports.exit = core.exit;
1179
723
  /**
1180
- * Enable/disable request batching within an Fx
1181
- * @since 1.18.0
1182
- * @category batching
724
+ * @since 1.20.0
1183
725
  */
1184
- const withRequestBatching = exports.withRequestBatching = internal.withRequestBatching;
726
+ const either = exports.either = core.either;
1185
727
  /**
1186
- * Set the request cache Effects running within an Fx
1187
- * @since 1.18.0
1188
- * @category batching
728
+ * @since 1.20.0
1189
729
  */
1190
- const withRequestCache = exports.withRequestCache = internal.withRequestCache;
730
+ const tuple = exports.tuple = core.tuple;
1191
731
  /**
1192
- * Enable/disable request caching within an Fx
1193
- * @since 1.18.0
1194
- * @category batching
732
+ * @since 1.20.0
1195
733
  */
1196
- const withRequestCaching = exports.withRequestCaching = internal.withRequestCaching;
734
+ const struct = exports.struct = core.struct;
1197
735
  /**
1198
- * Configure the scheduler to use within an Fx
1199
- * @since 1.18.0
1200
- * @category concurrency
736
+ * @since 1.20.0
1201
737
  */
1202
- const withScheduler = exports.withScheduler = internal.withScheduler;
738
+ const all = exports.all = core.all;
1203
739
  /**
1204
- * Set the span of an Fx
1205
- * @since 1.18.0
1206
- * @category tracing
740
+ * @since 1.20.0
1207
741
  */
1208
- const withSpan = exports.withSpan = internal.withSpan;
742
+ const toEnqueue = exports.toEnqueue = /*#__PURE__*/(0, _Function.dual)(2, core.toEnqueue);
1209
743
  /**
1210
- * Set the tracer used within an Fx
1211
- * @since 1.18.0
1212
- * @category tracing
744
+ * @since 1.20.0
1213
745
  */
1214
- const withTracer = exports.withTracer = internal.withTracer;
746
+ const debounce = exports.debounce = /*#__PURE__*/(0, _Function.dual)(2, core.debounce);
1215
747
  /**
1216
- * Partition an Fx into two Fx's based on a either-returning function.
1217
- * @since 1.18.0
1218
- * @category combinators
748
+ * @since 1.20.0
1219
749
  */
1220
- const partitionMap = exports.partitionMap = internal.partitionMap;
750
+ const throttle = exports.throttle = /*#__PURE__*/(0, _Function.dual)(2, core.throttle);
1221
751
  /**
1222
- * Convert a list of keyed values into persistent workflows for given each key of the list
1223
- * even when the list has been re-ordered.
1224
- *
1225
- * @since 1.18.0
1226
- * @category combinators
752
+ * @since 1.20.0
1227
753
  */
1228
- const keyed = exports.keyed = /*#__PURE__*/(0, _Function.dual)(3, internalKeyed.keyed);
754
+ const throttleLatest = exports.throttleLatest = /*#__PURE__*/(0, _Function.dual)(2, core.throttleLatest);
1229
755
  /**
1230
- * Map an Fx of values into workflows similar to Fx.switchMap, but
1231
- * instead of providing the value directly, it is exposed as a RefSubject to
1232
- * allow creating a persistent workflows similar to Fx.keyed but for a single value.
1233
- *
1234
- * @since 1.18.0
1235
- * @category combinators
756
+ * @since 1.20.0
1236
757
  */
1237
- const withKey = exports.withKey = /*#__PURE__*/(0, _Function.dual)(3, internalWithKey.withKey);
758
+ const keyed = exports.keyed = /*#__PURE__*/(0, _Function.dual)(2, coreKeyed.keyed);
759
+ /**
760
+ * @since 1.20.0
761
+ */
762
+ const withKey = exports.withKey = /*#__PURE__*/(0, _Function.dual)(2, coreWithKey.withKey);
1238
763
  const getTag = a => a._tag;
1239
764
  /**
1240
765
  * Match over a tagged union of values into a set of persistent workflows
1241
766
  * that allow listening to changes of values with the same tag using the same
1242
767
  * Fx.
1243
768
  *
1244
- * @since 1.18.0
769
+ * @since 1.20.0
1245
770
  * @category combinators
1246
771
  */
1247
772
  const matchTags = exports.matchTags = /*#__PURE__*/(0, _Function.dual)(2, function matchTags(fx, matchers) {
1248
- return withKey(fx, getTag, (ref, tag) => matchers[tag](ref));
773
+ return withKey(fx, {
774
+ getKey: getTag,
775
+ onValue: (ref, tag) => matchers[tag](ref)
776
+ });
1249
777
  });
1250
778
  /**
1251
- * @since 1.18.0
1252
- */
1253
- const drainLayer = exports.drainLayer = internal.drainLayer;
1254
- /* #endregion */
1255
- /**
1256
- * @since 1.18.0
1257
- */
1258
- function isFx(u) {
1259
- return typeof u === "object" && u !== null && _TypeId.TypeId in u;
1260
- }
1261
- /**
1262
- * @since 1.18.0
779
+ * @since 1.20.0
1263
780
  */
1264
781
  const matchOption = exports.matchOption = /*#__PURE__*/(0, _Function.dual)(3, function matchOption(fx, onNone, onSome) {
1265
782
  return matchTags(fx, {
@@ -1268,13 +785,13 @@ const matchOption = exports.matchOption = /*#__PURE__*/(0, _Function.dual)(3, fu
1268
785
  });
1269
786
  });
1270
787
  /**
1271
- * @since 1.18.0
788
+ * @since 1.20.0
1272
789
  */
1273
790
  const getOrElse = exports.getOrElse = /*#__PURE__*/(0, _Function.dual)(2, function getOrElse(fx, orElse) {
1274
791
  return matchOption(fx, orElse, _Function.identity);
1275
792
  });
1276
793
  /**
1277
- * @since 1.18.0
794
+ * @since 1.20.0
1278
795
  */
1279
796
  const matchEither = exports.matchEither = /*#__PURE__*/(0, _Function.dual)(3, function matchEither(fx, onLeft, onRight) {
1280
797
  return matchTags(fx, {
@@ -1283,31 +800,159 @@ const matchEither = exports.matchEither = /*#__PURE__*/(0, _Function.dual)(3, fu
1283
800
  });
1284
801
  });
1285
802
  /**
1286
- * @since 1.18.0
803
+ * @since 1.20.0
804
+ */
805
+ const at = exports.at = /*#__PURE__*/(0, _Function.dual)(2, (value, duration) => fromEffect(Effect.delay(Effect.succeed(value), duration)));
806
+ /**
807
+ * @since 1.20.0
808
+ */
809
+ function drainLayer(...fxs) {
810
+ return Layer.scopedDiscard(Effect.forkWithErrorHandler(core.drain(core.mergeAll(fxs)), Effect.logError));
811
+ }
812
+ /**
813
+ * @since 1.20.0
1287
814
  */
1288
815
  const fork = fx => Effect.fork(drain(fx));
1289
816
  /**
1290
- * @since 1.18.0
817
+ * @since 1.20.0
1291
818
  */
1292
819
  exports.fork = fork;
1293
820
  const forkScoped = fx => Effect.forkScoped(drain(fx));
1294
821
  /**
1295
- * @since 1.18.0
822
+ * @since 1.20.0
1296
823
  */
1297
824
  exports.forkScoped = forkScoped;
1298
825
  const forkDaemon = fx => Effect.forkDaemon(drain(fx));
1299
826
  /**
1300
- * @since 1.18.0
827
+ * @since 1.20.0
1301
828
  */
1302
829
  exports.forkDaemon = forkDaemon;
1303
830
  const forkIn = exports.forkIn = /*#__PURE__*/(0, _Function.dual)(2, (fx, scope) => Effect.forkIn(drain(fx), scope));
1304
831
  /**
1305
- * @since 1.18.0
832
+ * @since 1.20.0
833
+ */
834
+ const fromAsyncIterable = exports.fromAsyncIterable = core.fromAsyncIterable;
835
+ /**
836
+ * @since 1.20.0
837
+ */
838
+ const partitionMap = exports.partitionMap = /*#__PURE__*/(0, _Function.dual)(2, function partitionMap(fx, f) {
839
+ const source = coreShare.multicast(core.map(fx, f));
840
+ return [core.filterMap(source, Either.getLeft), core.filterMap(source, Either.getRight)];
841
+ });
842
+ /**
843
+ * @since 1.20.0
844
+ */
845
+ const gen = exports.gen = core.gen;
846
+ /**
847
+ * @since 1.20.0
848
+ */
849
+ const genScoped = exports.genScoped = core.genScoped;
850
+ /**
851
+ * @since 1.20.0
852
+ */
853
+ const findFirst = exports.findFirst = /*#__PURE__*/(0, _Function.dual)(2, core.findFirst);
854
+ /**
855
+ * @since 1.20.0
856
+ */
857
+ const first = exports.first = core.first;
858
+ /**
859
+ * @since 1.20.0
860
+ */
861
+ const mergeFirst = exports.mergeFirst = /*#__PURE__*/(0, _Function.dual)(2, core.mergeFirst);
862
+ /**
863
+ * @since 1.20.0
864
+ */
865
+ const mergeRace = exports.mergeRace = /*#__PURE__*/(0, _Function.dual)(2, core.mergeRace);
866
+ /**
867
+ * @since 1.20.0
868
+ */
869
+ const raceAll = exports.raceAll = core.raceAll;
870
+ /**
871
+ * @since 1.20.0
872
+ */
873
+ const race = exports.race = /*#__PURE__*/(0, _Function.dual)(2, core.race);
874
+ /**
875
+ * @since 1.20.0
876
+ */
877
+ const snapshot = exports.snapshot = /*#__PURE__*/(0, _Function.dual)(3, core.snapshot);
878
+ /**
879
+ * @since 1.20.0
880
+ */
881
+ const sample = exports.sample = /*#__PURE__*/(0, _Function.dual)(2, core.sample);
882
+ /**
883
+ * @since 1.20.0
884
+ */
885
+ const snapshotEffect = exports.snapshotEffect = /*#__PURE__*/(0, _Function.dual)(3, core.snapshotEffect);
886
+ const if_ = exports.if = /*#__PURE__*/(0, _Function.dual)(2, core.if);
887
+ /**
888
+ * @since 1.20.0
889
+ */
890
+ const when = exports.when = /*#__PURE__*/(0, _Function.dual)(2, core.when);
891
+ /**
892
+ * @since 1.20.0
1306
893
  */
1307
- const mergeRace = exports.mergeRace = internal.mergeRace;
894
+ const withEmitter = f => core.make(sink => Emitter.withEmitter(sink, f));
1308
895
  /**
896
+ * Create an Fx which will wait a specified duration of time where no
897
+ * events have occurred before emitting a value.
1309
898
  * @since 1.18.0
1310
899
  */
1311
- class FxEffectBase extends internalProtos.FxEffectBase {}
900
+ exports.withEmitter = withEmitter;
901
+ const delay = exports.delay = /*#__PURE__*/(0, _Function.dual)(2, function (fx, delay) {
902
+ return core.flatMap(fx, a => core.fromEffect(Effect.delay(Effect.succeed(a), delay)));
903
+ });
904
+ /**
905
+ * @since 1.20.0
906
+ */
907
+ const ensuring = exports.ensuring = /*#__PURE__*/(0, _Function.dual)(2, function (self, finalizer) {
908
+ return core.middleware(self, effect => Effect.ensuring(effect, finalizer));
909
+ });
910
+ /**
911
+ * @since 1.20.0
912
+ */
913
+ const flip = fx => core.make(sink => fx.run(Sink.make(cause => Either.match(Cause.failureOrCause(cause), {
914
+ onLeft: e => sink.onSuccess(e),
915
+ onRight: c => sink.onFailure(c)
916
+ }), a => sink.onFailure(Cause.fail(a)))));
917
+ /**
918
+ * @since 1.20.0
919
+ */
920
+ exports.flip = flip;
921
+ const fromNullable = value => {
922
+ if (value === null || value === undefined) {
923
+ return core.empty;
924
+ } else {
925
+ return core.succeed(value);
926
+ }
927
+ };
928
+ exports.fromNullable = fromNullable;
929
+ function fromDequeue(dequeue) {
930
+ return core.make(sink => Effect.repeatWhileEffect(Effect.matchCauseEffect(dequeue.take, sink), () => dequeueIsActive(dequeue)));
931
+ }
932
+ /**
933
+ * @internal
934
+ */
935
+ function dequeueIsActive(dequeue) {
936
+ if (Queue.DequeueTypeId in dequeue) {
937
+ return Effect.sync(() => dequeue.isActive());
938
+ } else {
939
+ return dequeue.isActive;
940
+ }
941
+ }
942
+ function fromPubSub(pubSub) {
943
+ return core.acquireUseRelease(pubSub.subscribe, q => fromDequeue(q), d => d.shutdown);
944
+ }
945
+ /**
946
+ * @since 1.20.0
947
+ */
948
+ class FxEffectBase extends protos.FxEffectBase {
949
+ _fx;
950
+ /**
951
+ * @since 1.20.0
952
+ */
953
+ run(sink) {
954
+ return (this._fx ||= this.toFx()).run(sink);
955
+ }
956
+ }
1312
957
  exports.FxEffectBase = FxEffectBase;
1313
958
  //# sourceMappingURL=Fx.js.map