Skip to content

Commit

Permalink
(result doc) More documentation for Result
Browse files Browse the repository at this point in the history
Also Renames .errorMap → .mapError

BREAKING CHANGE: The name `.mapError` is a better description for the operation.

Also deprecates .get in favour of .unsafeGet (#42)
  • Loading branch information
robotlolita committed Feb 11, 2017
1 parent f5afaf5 commit 81b798b
Show file tree
Hide file tree
Showing 4 changed files with 818 additions and 177 deletions.
8 changes: 4 additions & 4 deletions docs/source/en/data/maybe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ If we have maybe, we can change our code from::
find1([1, 2, 3], (x) => x > 2); // ==> 3
find1([1, 2, 3], (x) => x > 3); // ==> null

To:
To::

const Maybe = require('folktale/data/maybe');

Expand Down Expand Up @@ -128,7 +128,7 @@ We'll see each of these categories in more details below.

If we're wrapping a value in a Maybe, then we can use the value by extracting it
from that container. Folktale lets you do this through the `getOrElse(default)`
method:
method::

const Maybe = require('folktale/data/maybe');

Expand Down Expand Up @@ -161,7 +161,7 @@ UI elements with the data from that object, but the list can be empty so you
have to handle that error first. We can't use `getOrElse()` here because if we
have an error, we don't want to render that error in the same way. Instead, we
can use `map(transformation)` to apply our rendering logic only to successful
values:
values::

const Maybe = require('folktale/data/maybe');

Expand All @@ -175,7 +175,7 @@ values:
}

first([{ title: 'Hello' }]).map(render);
// ==> Maybe.Just(['item', ['title', 'Hello']])
// => Maybe.Just(['item', ['title', 'Hello']])

first([]).map(render);
// ==> Maybe.Nothing()
Expand Down
Loading

0 comments on commit 81b798b

Please sign in to comment.