You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a couple of interesting expansions you can consider with this lib:
Consider allowing objects to be defaults, not just literals. I assume this would mean the default cannot simply be passed back, but must first be assigned to target[property]. (However in order to avoid object reference hell, perhaps # 2 will help too.)
Accept a callback for the default option, that takes in the index and assigns the returned value (like a new object!) to that array item.
The text was updated successfully, but these errors were encountered:
crazy4groovy
changed the title
Support for object default
Support for object and callback defaults
Nov 6, 2021
Hi, I like this lib a lot; it reminds me of Groovy's support for default values:
https://blog.mrhaki.com/2012/10/groovy-goodness-create-list-with.html
There are a couple of interesting expansions you can consider with this lib:
Consider allowing objects to be defaults, not just literals. I assume this would mean the
default
cannot simply be passed back, but must first be assigned totarget[property]
. (However in order to avoid object reference hell, perhaps # 2 will help too.)Accept a callback for the
default
option, that takes in theindex
and assigns the returned value (like a new object!) to that array item.The text was updated successfully, but these errors were encountered: