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
currently, there is defaultValue argument as simple value like this...
var someValue: Int by settings.int("key", defaultValue = -1)
I'd be nice to have the default value deferred to the time when it's actually read, so I can use for example remote config or any other external dependency which might have some async loading with some default fallback like android/firebase remote config has.
usage would be for example this, so the remote config value would be used at the time when the someValue is actually read and not at the time when the owner instance object is created, then it gives a time potentially to remote config to sync
var someValue: Int by settings.int("key", { remoteConfig.key() } )
The text was updated successfully, but these errors were encountered:
I'm wary of adding more variants to the existing API since there's already a lot of different calling conventions between nullable and non-null standard getters, operator getters, delegates, suspend/flow stuff, etc. I'll think about this, though. It might work well as a separate module. In the meantime, you can implement it yourself by doing something like
currently, there is
defaultValue
argument as simple value like this...I'd be nice to have the default value deferred to the time when it's actually read, so I can use for example remote config or any other external dependency which might have some async loading with some default fallback like android/firebase remote config has.
usage would be for example this, so the remote config value would be used at the time when the
someValue
is actually read and not at the time when the owner instance object is created, then it gives a time potentially to remote config to syncThe text was updated successfully, but these errors were encountered: