Skip to content

Commit

Permalink
Version 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaq committed Apr 6, 2021
1 parent 4a8d3c1 commit 9385fdc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 29 deletions.
78 changes: 54 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ Brings back [Fluture][]'s fluent method API, for the nostalgic developer.

## Usage

### Node

```console
$ npm install --save fluenture
```

On Node 12 and up, this module can be loaded directly with `import` or
`require`. On Node versions below 12, `require` or the [esm][]-loader can
be used.

### Deno and Modern Browsers

You can load the EcmaScript module from various content delivery networks:

- [Skypack](https://cdn.skypack.dev/fluenture@3.1.0)
- [JSPM](https://jspm.dev/fluenture@3.1.0)
- [jsDelivr](https://cdn.jsdelivr.net/npm/fluenture@3.1.0/+esm)

### Old Browsers and Code Pens

There's a [UMD][] file included in the NPM package, also available via
jsDelivr: https://cdn.jsdelivr.net/npm/fluenture@3.1.0/dist/umd.js

This file adds `fluenture` to the global scope, or use CommonJS/AMD
when available.

### Usage Example

```js
import {resolve, reject} from 'fluture';
import {fluent} from 'fluenture';
Expand All @@ -22,19 +50,19 @@ that were enhanced with a fluent method API. One can think of the
`Fluenture` type as a *subtype* of `Future`: any instances of it are also
instances of `Future`.

#### <a name="fluent" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L109">`fluent :: Future a b -⁠> Fluenture a b`</a>
#### <a name="fluent" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L137">`fluent :: Future a b -⁠> Fluenture a b`</a>

Enhance a Future with the fluent method API.

This function is idempotent.

#### <a name="functional" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L123">`functional :: Future a b -⁠> Future a b`</a>
#### <a name="functional" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L151">`functional :: Future a b -⁠> Future a b`</a>

Strip a fluent Future (or "Fluenture") from its method API.

This function is idempotent.

#### <a name="pipe" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L148">`pipe :: (Future a b -⁠> c) -⁠> c`</a>
#### <a name="pipe" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L176">`pipe :: (Future a b -⁠> c) -⁠> c`</a>

This function is equivalent to Fluture's built-in `pipe` function, with
once exception; If a Future is returned from the given function, it is
Expand All @@ -43,88 +71,90 @@ method chain intact.

Fluent [`pipe`](https://github.com/fluture-js/Fluture#pipe).

#### <a name="alt" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L162">`alt :: Fluenture a b ~> Future a b -⁠> Fluenture a b`</a>
#### <a name="alt" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L190">`alt :: Fluenture a b ~> Future a b -⁠> Fluenture a b`</a>

Fluent [`alt`](https://github.com/fluture-js/Fluture#alt).

#### <a name="and" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L168">`and :: Fluenture a b ~> Future a b -⁠> Fluenture a b`</a>
#### <a name="and" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L196">`and :: Fluenture a b ~> Future a b -⁠> Fluenture a b`</a>

Fluent [`and`](https://github.com/fluture-js/Fluture#and).

#### <a name="ap" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L173">`ap :: Fluenture a b ~> Future a (b -⁠> c) -⁠> Fluenture a c`</a>
#### <a name="ap" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L201">`ap :: Fluenture a b ~> Future a (b -⁠> c) -⁠> Fluenture a c`</a>

Fluent [`ap`](https://github.com/fluture-js/Fluture#ap).

#### <a name="bichain" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L179">`bichain :: Fluenture a b ~> (a -⁠> Fluenture a c, b -⁠> Fluenture a c) -⁠> Fluenture a c`</a>
#### <a name="bichain" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L207">`bichain :: Fluenture a b ~> (a -⁠> Fluenture a c, b -⁠> Fluenture a c) -⁠> Fluenture a c`</a>

Fluent [`bichain`](https://github.com/fluture-js/Fluture#bichain).

#### <a name="bimap" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L184">`bimap :: Fluenture a b ~> (a -⁠> c, b -⁠> d) -⁠> Fluenture c d`</a>
#### <a name="bimap" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L212">`bimap :: Fluenture a b ~> (a -⁠> c, b -⁠> d) -⁠> Fluenture c d`</a>

Fluent [`bimap`](https://github.com/fluture-js/Fluture#bimap).

#### <a name="both" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L190">`both :: Fluenture a b ~> Future a c -⁠> Fluenture a (Pair b c)`</a>
#### <a name="both" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L218">`both :: Fluenture a b ~> Future a c -⁠> Fluenture a (Pair b c)`</a>

Fluent [`both`](https://github.com/fluture-js/Fluture#both).

#### <a name="cache" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L195">`cache :: Fluenture a b ~> () -⁠> Fluenture a b`</a>
#### <a name="cache" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L223">`cache :: Fluenture a b ~> () -⁠> Fluenture a b`</a>

Fluent [`cache`](https://github.com/fluture-js/Fluture#cache).

#### <a name="chain" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L200">`chain :: Fluenture a b ~> (b -⁠> Fluenture a c) -⁠> Fluenture a c`</a>
#### <a name="chain" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L228">`chain :: Fluenture a b ~> (b -⁠> Fluenture a c) -⁠> Fluenture a c`</a>

Fluent [`chain`](https://github.com/fluture-js/Fluture#chain).

#### <a name="chainRej" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L206">`chainRej :: Fluenture a b ~> (a -⁠> Fluenture c b) -⁠> Fluenture c b`</a>
#### <a name="chainRej" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L234">`chainRej :: Fluenture a b ~> (a -⁠> Fluenture c b) -⁠> Fluenture c b`</a>

Fluent [`chainRej`](https://github.com/fluture-js/Fluture#chainRej).

#### <a name="coalesce" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L211">`coalesce :: Fluenture a b ~> (a -⁠> c, b -⁠> c) -⁠> Fluenture d c`</a>
#### <a name="coalesce" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L239">`coalesce :: Fluenture a b ~> (a -⁠> c, b -⁠> c) -⁠> Fluenture d c`</a>

Fluent [`coalesce`](https://github.com/fluture-js/Fluture#coalesce).

#### <a name="lastly" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L216">`lastly :: Fluenture a b ~> Future a c -⁠> Fluenture a b`</a>
#### <a name="lastly" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L244">`lastly :: Fluenture a b ~> Future a c -⁠> Fluenture a b`</a>

Fluent [`lastly`](https://github.com/fluture-js/Fluture#lastly).

#### <a name="map" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L221">`map :: Fluenture a b ~> (b -⁠> c) -⁠> Fluenture a c`</a>
#### <a name="map" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L249">`map :: Fluenture a b ~> (b -⁠> c) -⁠> Fluenture a c`</a>

Fluent [`map`](https://github.com/fluture-js/Fluture#map).

#### <a name="mapRej" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L227">`mapRej :: Fluenture a b ~> (a -⁠> c) -⁠> Fluenture c b`</a>
#### <a name="mapRej" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L255">`mapRej :: Fluenture a b ~> (a -⁠> c) -⁠> Fluenture c b`</a>

Fluent [`mapRej`](https://github.com/fluture-js/Fluture#mapRej).

#### <a name="pap" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L232">`pap :: Fluenture a b ~> Fluenture a (b -⁠> c) -⁠> Fluenture a c`</a>
#### <a name="pap" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L260">`pap :: Fluenture a b ~> Fluenture a (b -⁠> c) -⁠> Fluenture a c`</a>

Fluent [`pap`](https://github.com/fluture-js/Fluture/#pap).

#### <a name="race" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L237">`race :: Fluenture a b ~> Future a b -⁠> Fluenture a b`</a>
#### <a name="race" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L265">`race :: Fluenture a b ~> Future a b -⁠> Fluenture a b`</a>

Fluent [`race`](https://github.com/fluture-js/Fluture#race).

#### <a name="swap" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L242">`swap :: Fluenture a b ~> () -⁠> Fluenture b a`</a>
#### <a name="swap" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L270">`swap :: Fluenture a b ~> () -⁠> Fluenture b a`</a>

Fluent [`swap`](https://github.com/fluture-js/Fluture#swap).

#### <a name="done" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L247">`done :: Fluenture a b ~> (b -⁠> c) -⁠> Cancel`</a>
#### <a name="done" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L275">`done :: Fluenture a b ~> (b -⁠> c) -⁠> Cancel`</a>

Fluent [`done`](https://github.com/fluture-js/Fluture#done).

#### <a name="fork" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L252">`fork :: Fluenture a b ~> (a -⁠> c, b -⁠> d) -⁠> Cancel`</a>
#### <a name="fork" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L280">`fork :: Fluenture a b ~> (a -⁠> c, b -⁠> d) -⁠> Cancel`</a>

Fluent [`fork`](https://github.com/fluture-js/Fluture#fork).

#### <a name="forkCatch" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L257">`forkCatch :: Fluenture a b ~> (Error -⁠> c, a -⁠> d, b -⁠> e) -⁠> Cancel`</a>
#### <a name="forkCatch" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L285">`forkCatch :: Fluenture a b ~> (Error -⁠> c, a -⁠> d, b -⁠> e) -⁠> Cancel`</a>

Fluent [`forkCatch`](https://github.com/fluture-js/Fluture#forkCatch).

#### <a name="promise" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L262">`promise :: Fluenture Error a ~> () -⁠> Promise Error a`</a>
#### <a name="promise" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L290">`promise :: Fluenture Error a ~> () -⁠> Promise Error a`</a>

Fluent [`promise`](https://github.com/fluture-js/Fluture#promise).

#### <a name="value" href="https://github.com/fluture-js/fluenture/blob/v3.0.0/index.js#L267">`value :: Fluenture a b ~> ((Nullable a, b) -⁠> c) -⁠> Cancel`</a>
#### <a name="value" href="https://github.com/fluture-js/fluenture/blob/v3.1.0/index.js#L295">`value :: Fluenture a b ~> ((Nullable a, b) -⁠> c) -⁠> Cancel`</a>

Fluent [`value`](https://github.com/fluture-js/Fluture#value).

[Fluture]: https://github.com/fluture-js/Fluture
[esm]: https://github.com/standard-things/esm
[UMD]: https://github.com/umdjs/umd
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
//.
//. You can load the EcmaScript module from various content delivery networks:
//.
//. - [Skypack](https://cdn.skypack.dev/fluenture@3.0.0)
//. - [JSPM](https://jspm.dev/fluenture@3.0.0)
//. - [jsDelivr](https://cdn.jsdelivr.net/npm/fluenture@3.0.0/+esm)
//. - [Skypack](https://cdn.skypack.dev/fluenture@3.1.0)
//. - [JSPM](https://jspm.dev/fluenture@3.1.0)
//. - [jsDelivr](https://cdn.jsdelivr.net/npm/fluenture@3.1.0/+esm)
//.
//. ### Old Browsers and Code Pens
//.
//. There's a [UMD][] file included in the NPM package, also available via
//. jsDelivr: https://cdn.jsdelivr.net/npm/fluenture@3.0.0/dist/umd.js
//. jsDelivr: https://cdn.jsdelivr.net/npm/fluenture@3.1.0/dist/umd.js
//.
//. This file adds `fluenture` to the global scope, or use CommonJS/AMD
//. when available.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluenture",
"version": "3.0.0",
"version": "3.1.0",
"description": "Bring back Fluture's fluent method API",
"keywords": [
"fluent",
Expand Down

0 comments on commit 9385fdc

Please sign in to comment.