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

[New Library] AndroidX WorkManager extensions #3

Open
5 tasks
EdricChan03 opened this issue Jun 30, 2023 · 0 comments
Open
5 tasks

[New Library] AndroidX WorkManager extensions #3

EdricChan03 opened this issue Jun 30, 2023 · 0 comments
Labels
api request Request for a new API enhancement New feature or request library request Request for a new library

Comments

@EdricChan03
Copy link
Owner

EdricChan03 commented Jun 30, 2023

AndroidX WorkManager currently does have a KTX module, but it doesn't provide a lot of utilities :/

API suggestions

  • WorkInfo methods which return a Flow instead of LiveData (note: 2.9.0-alpha01 already offers such a feature, so we should provide a backwards-compatible Kotlin extension that emulates the 2.9.0-alpha01 methods on <=2.8.0)

  • [WorkManager] Better Kotlin DSL for Data #4

    val workData = buildData {
      // Perhaps we can have similar utilities to that of a MutableMap?
      this += "key" to 123
      this += workDataOf(/* ... */) // Add existing data
      addData {
        // Add data from a Data.Builder
        putBoolean("abc", false)
      }
    
      this -= workDataOf(/* ... */) // Remove the mutable data's properties that are present in the specified Data
    }
  • Add suspend methods for methods that return a LiveData

  • Add worker request methods that accept a java.time.Duration/kotlin.time.Duration instead of a Long + TimeUnit

  • Add top-level methods to create anonymous objects of interfaces (for e.g. RunnableScheduler)

@EdricChan03 EdricChan03 added enhancement New feature or request library request Request for a new library api request Request for a new API labels Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api request Request for a new API enhancement New feature or request library request Request for a new library
Projects
Status: 🏗 In progress
Development

No branches or pull requests

1 participant