Skip to content

Commit

Permalink
Updated example, improved reduce, allowed easy eager evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
KoryNunn committed Feb 23, 2017
1 parent 8c3dcde commit 58a6606
Show file tree
Hide file tree
Showing 7 changed files with 602 additions and 170 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,42 @@ getBar(function(error, result){
});
```

## Immediately execute

You can force a righto task for run at any time without dealing with the results (or error) by calling
it with no arguments:

```
// Lazily resolve (won't run untill called)
var something = righto(getSomething);
// Force something to start resolving *now*
something();
// later ...
something(function(error, result){
// handle error or use result.
});
```

Also, since righto tasks return themselves when called, you can do this a little more shorthand, like so:



```
// Immediately force the righto to begin resolving.
var something = righto(getSomething)(); // <= note the call with no arguments.
// later ...
something(function(error, result){
// handle error or use result.
});
```

## Take / Multiple results

By default, dependent tasks are passed only the first result of a dependency `righto`. eg:
Expand Down
Loading

0 comments on commit 58a6606

Please sign in to comment.