You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core functions. **Note:**`_` represents the future itself as inserted by `->` (the [fast pipe](https://bucklescript.github.io/docs/en/fast-pipe.html) operator).
87
+
Core functions. **Note:**`_` represents the future itself as inserted by `->` (the [pipe](https://rescript-lang.org/docs/manual/latest/pipe) operator).
83
88
84
89
-`Future.make(resolver)` - Create a new, potentially-async future.
85
90
-`Future.value(x)` - Create a new future with a plain value (synchronous).
@@ -89,15 +94,15 @@ Core functions. **Note:** `_` represents the future itself as inserted by `->` (
89
94
-`Future.tap(_,fn)` - Do something with the value of a future without changing it. Returns the same future so you can continue using it in a pipeline. Convenient for side effects such as console logging.
90
95
-`Future.all(_,fn)` - Turn a list of futures into a future of a list. Used when you want to wait for a collection of futures to complete before doing something (equivalent to Promise.all in Javascript).
91
96
92
-
### Belt.Result
97
+
### Result
93
98
94
-
Convenience functions when working with a future `Belt.Result`. **Note:**`_` represents the future itself as inserted by `->` (the [fast pipe](https://bucklescript.github.io/docs/en/fast-pipe.html) operator).
99
+
Convenience functions when working with a future `Result`. **Note:**`_` represents the future itself as inserted by `->` (the [pipe](https://rescript-lang.org/docs/manual/latest/pipe) operator).
95
100
96
-
**Note 2**: The terms `Result.Ok` and `Result.Error` in this context are expected to be read as `Belt.Result.Ok` and `Belt.Result.Error`.
101
+
**Note 2**: The terms `Result.Ok` and `Result.Error` in this context are expected to be read as `Ok` and `Error`.
97
102
98
103
-`Future.mapOk(_,fn)` - Transform a future value into another value, but only if the value is an `Result.Ok`. Similar to `Promise.prototype.then`
99
104
-`Future.mapError(_,fn)` - Transform a future value into another value, but only if the value is an `Result.Error`. Similar to `Promise.prototype.catch`
100
-
-`Future.tapOk(_,fn)` - Do something with the value of a future without changing it, but only if the value is a `Belt.Result.Ok`. Returns the same future. Convenience for side effects such as console logging.
105
+
-`Future.tapOk(_,fn)` - Do something with the value of a future without changing it, but only if the value is a `Ok`. Returns the same future. Convenience for side effects such as console logging.
101
106
-`Future.tapError(_,fn)` - Same as `tapOk` but for `Result.Error`
102
107
103
108
The following are more situational:
@@ -112,18 +117,18 @@ a future `Result`. Flattens the inner future.
112
117
Convenience functions for interop with JavaScript land.
0 commit comments