diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0b77095 --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +docs +jsdoc-template \ No newline at end of file diff --git a/README.md b/README.md index f2d70fb..a38e0d2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,19 @@ const result = new Fuse(a) .on(x => x===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 diff --git a/package.json b/package.json index 15fc9c1..eb4a75a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@codefeathers/fuse", - "version": "0.10.0", - "description": "Return a function based on a condition. A functional alternative to switch-case.", + "version": "0.10.1", + "description": " FunctionSelect: Select a function that passes a condition. A functional alternative to switch-case.", "main": "index.js", "scripts": { "debug": "node --inspect-brk testscript",