Page MenuHomeSoftware Heritage

assets: Simplify promises handling with js async/await syntax
ClosedPublic

Authored by anlambert on Jun 14 2021, 6:02 PM.

Details

Summary

It enables to obtain a more readable code with less indentation levels.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D5866 (id=20999)

Rebasing onto a0db251b32...

Current branch diff-target is up to date.
Changes applied before test
commit f034c584719d0cb82fe9dd9a84cbe31cb42e675a
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Jun 14 17:59:01 2021 +0200

    assets: Simplify promises handling with js async/await syntax
    
    It enables to obtain a more readable code with less indentation levels.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/868/ for more details.

ardumont added a subscriber: ardumont.

lgtm.

Not sure i found this more readable.

It's definitely to be read like the good ol' imperative style with some async/await
keywords thrown here and there for the code to still be async ;)

Also definitely, we gain one indentation level as described.

assets/src/bundles/admin/origin-save.js
225

oops ;)

This revision is now accepted and ready to land.Jun 15 2021, 12:08 PM

Build is green

Patch application report for D5866 (id=21027)

Rebasing onto 740ad9ba51...

Current branch diff-target is up to date.
Changes applied before test
commit 2ba3891ea7e059cbb7ba0a671dbbf7cdef10230f
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Jun 14 17:59:01 2021 +0200

    assets: Simplify promises handling with js async/await syntax
    
    It enables to obtain a more readable code with less indentation levels.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/876/ for more details.