Closed hank121314 closed 1 year ago
Sorry for the delay of this PR and thanks for your code review 😄 !
No need to be sorry. This is open source. We do this stuff for fun when we can.
No need to be sorry. This is open source. We do this stuff for fun when we can.
Got it! Well said! Working on this stuff really makes me fun.
I have applied some changes, thanks for your code review once again!
By the way, we now have API docs: https://swiftpackageindex.com/sindresorhus/defaults/main/documentation/defaults/defaults
By the way, we now have API docs: swiftpackageindex.com/sindresorhus/defaults/main/documentation/defaults/defaults
This is awesome! It is much better than showing API in readme.md
! Thanks!
✨
Summary
Fixes: #108 .
Defaults
now accept default value as agetter
.Approach
Replace default value's type with type
typealias DefaultGetter = () -> Value
. And changeKey.defaultValue
to a computed property which getter isDefaultGetter
.Thanks
Sorry for the delay of this PR and thanks for your code review 😄 !