Rubico
[a]synchronous functional programming
README
rubico
[a]synchronous functional programming
- ```javascript [playground]
- const { pipe, map, filter } = rubico
- const isOdd = number => number % 2 == 1
- const asyncSquare = async number => number ** 2
- const numbers = [1, 2, 3, 4, 5]
- pipe(numbers, [
- filter(isOdd),
- map(asyncSquare),
- console.log, // [1, 9, 25]
- ])
- ```
Installation
with npm
- ```bash
- npm i rubico
- ```
require rubico in CommonJS.
- ```javascript
- // import rubico core globally
- require('rubico/global')
- // import rubico core as rubico
- const rubico = require('rubico')
- // import an operator from rubico core
- const pipe = require('rubico/pipe')
- // import rubico/x as x
- const x = require('rubico/x')
- // import an operator from rubico/x
- const defaultsDeep = require('rubico/x/defaultsDeep')
- // import rubico's Transducer module
- const Transducer = require('rubico/Transducer')
- ```
import rubico in the browser.
- ```html [htmlmixed]
- <script src="https://unpkg.com/rubico/dist/global.min.js"></script>
- <script src="https://unpkg.com/rubico/dist/rubico.min.js"></script>
- <script src="https://unpkg.com/rubico/dist/pipe.min.js"></script>
- <script src="https://unpkg.com/rubico/dist/x/defaultsDeep.min.js"></script>