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
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -90,22 +90,22 @@ Maybe.tryFirst(employees)
90
90
```
91
91
92
92
1.`tryFirst` finds the first employee in the array and wraps it in a `Maybe`. If the array is empty, a `Maybe` with no value is returned.
93
-
1.`tap`'s callback is only called if an employee was found and logs out that employees' information.
93
+
1.`tap`'s callback is only called if an employee was found and logs out that employee's information.
94
94
1.`bind`'s callback is only called if an employee was found and converts the `Maybe` wrapping it into to another `Maybe`.
95
95
1.`from` wraps the employee's manager in a `Maybe`. If the employee has no manager, a `Maybe` with no value is returned.
96
96
1.`or` supplies a fallback in the case that the employee has no manager so that as long as an employee was originally found, all the following operations will execute.
97
97
1.`map` converts the manager to a new object which contains both the manager and employee.
98
98
1.`match` executes its `some` function if an employee was originally found and that employee has a manager. Since we supplied a fallback manager with `or`, the `some` function of `match` will execute if we found an employee. The `none` function of `match` executes if we didn't find any employees.
99
99
100
-
See more examples of Maybe [in the docs](./docs/maybe.md) or [in the tests](./test/maybe).
100
+
See more examples of `Maybe`[in the docs](./docs/maybe.md) or [in the tests](./test/maybe).
101
101
102
102
### MaybeAsync
103
103
104
104
`MaybeAsync` represents a future value (`Promise`) that might or might not exist.
105
105
106
106
`MaybeAsync` works just like `Maybe`, but since it is asynchronous, its methods accept a `Promise<T>` in most cases and all of its value accessing methods/getters return a `Promise<T>`.
107
107
108
-
See more examples of Maybe[in the docs](./docs/maybeAsync.md) or [in the tests](./test/maybeAsync).
108
+
See more examples of `MaybeAsync`[in the docs](./docs/maybeAsync.md) or [in the tests](./test/maybeAsync).
109
109
110
110
### Result
111
111
@@ -171,7 +171,7 @@ Result.try(
171
171
1.`map`'s callback is only called if the original employee was found, has a `managerId` and that manager was also found. It converts the manager returned by `try` to a new object capturing both the manager and employee's name.
172
172
1.`match`'s `success` callback is only called if all the required information was retrieved and sends a reminder to the employee's manager. The `failure` callback is called if any of the required data could not be retrieved and sends an alert to the business supervisor with the error message.
173
173
174
-
See more examples of Maybe[in the docs](./docs/result.md) or [in the tests](./test/result).
174
+
See more examples of `Result`[in the docs](./docs/result.md) or [in the tests](./test/result).
175
175
176
176
### ResultAsync
177
177
@@ -198,4 +198,4 @@ const result = await resultAsync.toPromise();
198
198
console.log(result.getErrorOrThrow()); // 'Could not retrieve inventory: connection failure'
199
199
```
200
200
201
-
See more examples of Maybe[in the docs](./docs/resultAsync.md) or [in the tests](./test/resultAsync).
201
+
See more examples of `ResultAsync`[in the docs](./docs/resultAsync.md) or [in the tests](./test/resultAsync).
0 commit comments