Commit Graph

6 Commits

Author SHA1 Message Date
Richard Hansen 05e0e8dbf7 hooks: New `callAllSerial()` function
This is necessary to migrate away from `callAll()` (which only
supports synchronous hook functions).
2021-02-02 09:09:02 +00:00
Richard Hansen ba0544ea9e hooks: Add unit tests for `callFirst()`, `aCallFirst()` 2021-02-02 09:09:02 +00:00
Richard Hansen 47f0a7dacf lint: Fix more ESLint errors 2021-02-02 09:09:02 +00:00
Richard Hansen b8d07a42eb lint: Run `eslint --fix` on `bin/` and `tests/` 2020-11-24 20:06:12 +00:00
Richard Hansen d624aa936e plugins: Fix plugin name in error messages 2020-11-13 20:30:27 +00:00
Richard Hansen 36aceb3aba hooks: Rewrite `callAll` and `aCallAll` for consistency
Rewrite the `callAll` and `aCallAll` functions to support all
reasonable hook behaviors and to report errors for unreasonable
behaviors (e.g., calling the callback twice).

Now a hook function like the following works as expected when invoked
by `aCallAll`:

```
exports.myHookFn = (hookName, context, cb) => {
  cb('some value');
  return;
};
```
2020-10-24 16:08:50 +01:00