Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevemao/composition-trace
Impure trace function to see what's going on in a composition
https://github.com/stevemao/composition-trace
composition debug debugger debugging debugging-tool fp functional-programming
Last synced: 9 days ago
JSON representation
Impure trace function to see what's going on in a composition
- Host: GitHub
- URL: https://github.com/stevemao/composition-trace
- Owner: stevemao
- Created: 2017-05-11T04:04:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-27T04:21:52.000Z (over 7 years ago)
- Last Synced: 2024-10-19T20:00:08.397Z (27 days ago)
- Topics: composition, debug, debugger, debugging, debugging-tool, fp, functional-programming
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Problem
```js
var dasherize = compose(join('-'), toLower, split(' '), replace(/\s{2,}/ig, ' '));dasherize('The world is a vampire');
// TypeError: Cannot read property 'apply' of undefined
```What arguments is `toLower` called with?
What does `split(' ')` return?# Let's `trace`
```js
const trace = require('composition-trace');var dasherize = compose(join('-'), toLower, trace('after split'), split(' '), replace(/\s{2,}/ig, ' '));
// after split [ 'The', 'world', 'is', 'a', 'vampire' ]dasherize('The world is a vampire');
```For more details, please see https://drboolean.gitbooks.io/mostly-adequate-guide/content/ch5.html#debugging
# Alternatives
- [treis](https://github.com/raine/treis)
- [`tap`](http://ramdajs.com/docs/#tap)
- [`do`](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/do.md)# Related
- [inspect-curry](https://github.com/stevemao/inspect-curry)
- [inspect-compose](https://github.com/stevemao/inspect-compose)