https://github.com/stevemao/composition-debugger
Set a breakpoint in a composition
https://github.com/stevemao/composition-debugger
compose composition debug debugger fp
Last synced: 4 months ago
JSON representation
Set a breakpoint in a composition
- Host: GitHub
- URL: https://github.com/stevemao/composition-debugger
- Owner: stevemao
- Created: 2018-06-13T04:38:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-13T04:45:37.000Z (about 7 years ago)
- Last Synced: 2025-01-20T16:05:54.803Z (5 months ago)
- Topics: compose, composition, debug, debugger, fp
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- 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 `debugger`
```js
// index.js
const cdebugger = require('composition-debugger');var dasherize = compose(join('-'), toLower, cdebugger, split(' '), replace(/\s{2,}/ig, ' '));
// nodejs will pause after `split(' ')`dasherize('The world is a vampire');
```Check https://nodejs.org/en/docs/guides/debugging-getting-started/ for details on how to pause on breakpoints.
One quick way is:
```
node inspect index.js
```# 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)
- [composition-trace](https://github.com/stevemao/composition-trace)# Related
- [inspect-curry](https://github.com/stevemao/inspect-curry)
- [inspect-compose](https://github.com/stevemao/inspect-compose)