FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

.progress should be able to return Progress, not Float · Issue #55 · freshOS/Then · GitHub

Repository navigation

.progress should be able to return Progress, not Float #55

Description

Currently, this library can only return Float value when using .progress directive.
However, Alamofire and other network libraries return Progress instance instead of Float.

I think thenPromise should be able to return Progress instance on .progress directive.
For example:

return Promise<URL> { resolve, reject, progress in
    Alamofire.download(escapedUrl, to: destination)
        .downloadProgress { downloadProgress in // downloadProgress is Progress class
            // let currentProgress = Float(downloadProgress.completedUnitCount) / Float(downloadProgress.totalUnitCount)
            // progress(currentProgress)
            progress(downloadProgress) // <- should be able to write like this
        }
        .response { response in
            ...
        }
}

Activity

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

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


      Back | FazBrowse Home | New Git URL