Skip to content

Add generic versions for getting Flow (and probably for adding listeners as well) #234

Open
@dalewking

Description

@dalewking

You have nice inline generic version for get/set that will choose the correct implementation based on the generic type. It would be nice to have inline generic versions like:

public inline fun <reified: T> ObservableSettings.getFlow() : Flow<T>
public inline fun <reified: T> ObservableSettings.getNullableFlow() : Flow<T>

although those could be computed extension properties instead.

I'm not using it but you would probably want something similar for adding listeners

public inline fun <reified: T> ObservableSettings.addListener(listener: (T) -> Unit) : SettingsListener
public inline fun <reified: T> ObservableSettings.addNullableListener(listener: (T?) -> Unit) : SettingsListener

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions