Openbravo Issue Tracking System - Retail Modules
View Issue Details
0044111Retail ModulesWeb POSpublic2020-05-19 18:172020-05-21 10:26
adrianromero 
adrianromero 
normalminorhave not tried
closedfixed 
5
 
RR20Q3 
marvintm
No
0044111: Improve hooks registration with Promises
ith modern Javascript keywords async / await is very convenient to provide a way to register asynchronous hooks without calling the callbacks. For example.

    OB.UTIL.HookManager.registerAsyncHook(
      'Hook_Qualifier',
      async args => {
        // Implementation of the hook
        // const condition = await ...
        // if (condition) {
        // throw new Error();
        // }
      }
    );
N/A
No tags attached.
Issue History
2020-05-19 18:17adrianromeroNew Issue
2020-05-19 18:17adrianromeroAssigned To => adrianromero
2020-05-19 18:17adrianromeroTriggers an Emergency Pack => No
2020-05-20 09:00hgbotCheckin
2020-05-20 09:00hgbotNote Added: 0120075
2020-05-20 09:00hgbotStatusnew => resolved
2020-05-20 09:00hgbotResolutionopen => fixed
2020-05-20 09:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ba6e30b31143e3cd05f4034da80d24b91a915c0b [^]
2020-05-20 09:03adrianromeroReview Assigned To => marvintm
2020-05-20 09:09hgbotCheckin
2020-05-20 09:09hgbotNote Added: 0120076
2020-05-21 10:26marvintmStatusresolved => closed
2020-05-21 10:26marvintmFixed in Version => RR20Q3

Notes
(0120075)
hgbot   
2020-05-20 09:00   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: ba6e30b31143e3cd05f4034da80d24b91a915c0b
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Tue May 19 18:18:56 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ba6e30b31143e3cd05f4034da80d24b91a915c0b [^]

Fixes ISSUE-44111: Improve hooks registration with Promises

---
M web/org.openbravo.mobile.core/source/utils/ob-hooks.js
---
(0120076)
hgbot   
2020-05-20 09:09   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 38cd9a07641db81b79461938f6d71e6a011ce822
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Wed May 20 09:09:31 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/38cd9a07641db81b79461938f6d71e6a011ce822 [^]

Related ISSUE-44111: Improve hooks registration with Promises
* Adds error that cancels hook execution to args

---
M web/org.openbravo.mobile.core/source/utils/ob-hooks.js
---