-
- Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the problem
Some feedback we've had on $inspect is that this...
console.log('>>> HERE', foo, bar, baz);...is a common pattern that doesn't work with $inspect, as it only takes a single value argument (in order to prevent ambiguity when providing a callback function).
Describe the proposed solution
@dummdidumm had a great idea — allow an arbitrary number of arguments, and put the callback in a .with method:
// these are effectively identical $inspect('>>> HERE', foo, bar, baz); $inspect('>>> HERE', foo, bar, baz).with(console.log); // can also use `console.trace` or `debugger`... $inspect('>>> HERE', foo, bar, baz).with(console.trace); $inspect('>>> HERE', foo, bar, baz).with((type, ...values) => { debugger; }); // ...or whatever custom logic you want to provide $inspect('>>> HERE', foo, bar, baz).with((type, ...values) => { klaxon.play(); });Alternatives considered
n/a
Importance
nice to have
brunnerh, dimfeld, techniq, eddiemcconkie, probablykasper and 8 more
Metadata
Metadata
Assignees
Labels
No labels