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
{{ message }}
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
Saw the need on Fenix to use a locally persisted string but having to first provide a value and ensuring this is fist persisted to then always be returned on subsequent requests.
This could be done manually in-place but a more general approach supported by default in StringPreference can also be extracted.
Confirmed with @Amejia481 an updated api that would add a new parameter:
persistDefaultIfNotExists: Boolean = false
which would mean no breaking changes
but an easy way to add the new behavior for the full api now being:
var persistedStringValue by stringPreference(
key ="permissions_enabled",
default ="blocked",
persistDefaultIfNotExists =true,
)
…value of a string preference
Moved the tests for string preferences to a new file where we can use
Robolectric for just this preferences type and test the actual behavior without
relying on mocking which would prevent full testing the change because of the
two readings using a `null` default.
…ing preference
Moved the tests for string preferences to a new file where we can use
Robolectric for just this preferences type and test the actual behavior without
relying on mocking which would prevent full testing the change because of the
two readings using a `null` default.
Saw the need on Fenix to use a locally persisted string but having to first provide a value and ensuring this is fist persisted to then always be returned on subsequent requests.
This could be done manually in-place but a more general approach supported by default in
StringPreference
can also be extracted.Confirmed with @Amejia481 an updated api that would add a new parameter:
which would mean no breaking changes
but an easy way to add the new behavior for the full api now being:
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: