-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Lazy type #101
Add Lazy type #101
Conversation
`Func` is a function that returns a `Node` that is itself also a `Node`. Used with `If`, it enables lazy evaluation of the node to return, depending on the condition passed to `If`. See also #99 for a different approach explored.
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 491 493 +2
=========================================
+ Hits 491 493 +2
Continue to review full report at Codecov.
|
This is a neat trick. I like this kind of lazy evaluation as it also works for if/else and even for something as |
Yeah, I think I like this solution too. Useful anywhere where lazy node evaluation could be nice. Maybe I should just call it |
Hmm. Sadly this doesn't work for attributes. I'll have to rethink a bit. |
Lazy
is a function that returns aNode
that is itself also aNode
.Used with
If
, it enables lazy evaluation of the node to return, depending on the condition passed toIf
.See also #99 for a different approach explored.