https://github.com/queckezz/transducer-protocol
Official protocol for transducers
https://github.com/queckezz/transducer-protocol
Last synced: 3 months ago
JSON representation
Official protocol for transducers
- Host: GitHub
- URL: https://github.com/queckezz/transducer-protocol
- Owner: queckezz
- License: mit
- Created: 2015-06-05T18:07:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-05T18:26:57.000Z (over 10 years ago)
- Last Synced: 2025-06-20T02:48:50.556Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 113 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# transducer-protocol
[](http://github.com/badges/stability-badges)
Official protocol for transducers based on [this spec](https://github.com/cognitect-labs/transducers-js#transformer-protocol).
## Usage
[](https://www.npmjs.com/package/transducer-protocol)
### Reduced implementation
where `p` is the protocol.
```js
const Reduced = value => {
return {
[p.value]: value,
[p.reduced]: true
}
}
```### Transformer implementation
```js
const transformer = () => {
return {
[p.init]: init ? () => init : notSupported,
[p.step]: step,
[p.result]: identity
}
}
```### Protocol
* protocol.init
* protocol.step
* protocol.result
* protocol.reduced
* protocol.value## License
MIT, see [license.md](http://github.com/queckezz/transducer-protocol/blob/master/license.md) for details.