Skip to content
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

[Hack Week] ApiFaker: Home screen and integration with the app #13064

Open
wants to merge 15 commits into
base: task/api-faker-1
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove explicit argument type
hichamboushaba committed Dec 5, 2024
commit a25dfe5a40eefbc3047237b708dcee6e2a7698a9
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ internal class ApiFakerConfig @Inject constructor(
preferences.edit().putBoolean(PREFERENCE_KEY, enabled).apply()
}

private fun SharedPreferences.prefFlow(key: String, defaultValue: Boolean) = callbackFlow<Boolean> {
private fun SharedPreferences.prefFlow(key: String, defaultValue: Boolean) = callbackFlow {
val listener = SharedPreferences.OnSharedPreferenceChangeListener { _, listenerKey ->
if (listenerKey == key) {
trySend(getBoolean(key, defaultValue))