Browse Source

[docs] Added FuseIterable case

master
Muthu Kumar 7 years ago
parent
commit
116f4174ca
  1. 2
      .npmignore
  2. 14
      README.md
  3. 4
      package.json

2
.npmignore

@ -0,0 +1,2 @@
docs
jsdoc-template

14
README.md

@ -19,7 +19,19 @@ const result = new Fuse(a)
.on(x => x===10, .on(x => x===10,
a => `${a} is 10.`) a => `${a} is 10.`)
console.log(result.resolve()); // -> "100 is greater than 10." console.log(result.resolve());
const arr = [ 0, 20, 30 ];
const temperature = new FuseIterable(arr)
.on(temp => temp<10,
() => `Too cold!`)
.on(temp => temp>=10 && temp <25,
() => `Just right.`)
.on(temp => temp>=25,
() => `Too warm!`)
console.log(temperature.resolve()); // -> [ "Too cold!", "Just right.", "Too warm!" ]
``` ```
## Docs ## Docs

4
package.json

@ -1,7 +1,7 @@
{ {
"name": "@codefeathers/fuse", "name": "@codefeathers/fuse",
"version": "0.10.0", "version": "0.10.1",
"description": "Return a function based on a condition. A functional alternative to switch-case.", "description": " FunctionSelect: Select a function that passes a condition. A functional alternative to switch-case.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"debug": "node --inspect-brk testscript", "debug": "node --inspect-brk testscript",

Loading…
Cancel
Save