-
-
Couldn't load subscription status.
- Fork 4.7k
Open
Description
Describe the problem
The ability to have dev-only code that is completely removed in production builds is a valuable tool beyond logging. To take advantage of this without logging, I can write:
$inspect(expensiveDebugAssertion()).with(() => {})This works, but .with(() => {}) is clunky and the usage is not obvious either to the reader or to developers who could use this technique.
Describe the proposed solution
An $inspect.by variant would be an elegant solution with similar usage as $derived.by:
// accepts function with no parameters
$inspect.by(expensiveDebugAssertion)Importance
nice to have
JohnKiller and webJose
Metadata
Metadata
Assignees
Labels
No labels