Skip to content

Remove LiveData #36

Description

@ValentinPostindustria

LiveData problem

Currently, the methods return results wrapped in LiveData. This is an Rx‑style approach that was popular on Android around 2020. Today it isn’t as widely used because Kotlin’s Flow and suspending coroutines have become the preferred way to handle asynchronous data streams.

I propose switching back to plain callbacks, which can then be converted into Flow or coroutine‑based APIs if needed. The current pattern for obtaining a result is cumbersome:

MainActivity.OPTABLE
    .targeting()
    .observe(viewLifecycleOwner) { result ->
        if (result.status == OptableSDK.Status.SUCCESS) {
            // …
        }
    }

By using simple callbacks, the code becomes more straightforward and can be easily wrapped into modern reactive constructs when required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions