Skip to content
This repository was archived by the owner on May 28, 2020. It is now read-only.
This repository was archived by the owner on May 28, 2020. It is now read-only.

Run Dispatch in a background thread #11

@Dimillian

Description

@Dimillian

In a big app, with potentially a lot of actions, I want to be able to dispatch all my functions on a serialised specified or not thread. At the moment there is no "easy" way to add this functionality without writing your final implementation of Store again to just change the dispatch method.

What I'm doing in ReSwift is extend Store and create my own dispatch like this

extension Store {
    open func dispatchQueue(_ action: Action) {
        DispatchQueue.flux().async {
            self.dispatchFunction(action)
        }
    }
}
let FLUX_QUEUE = DispatchQueue(label: "com.glose.ios.store.queue")

extension DispatchQueue {
    public class func flux() -> DispatchQueue {
        return FLUX_QUEUE
    }
}

I don't see any way to do that that in Kotlin and ReKotlin without writing your whole class Store again.

I'm I missing something?

Metadata

Metadata

Assignees

No one assigned

    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