You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`@feathersjs/hooks` brings middleware-like functionality to any async JavaScript or TypeScript function. It allows creation of composable and reusable workflows to handle functionality like
7
6
@@ -16,7 +15,7 @@
16
15
This functionality can be added without having to change the original function. The pattern also keeps everything cleanly separated and testable.
With TypeScript, you can use `hooks` the same was as shown in the above JavaScript example, or you can use decorators. Using decorators requires the `experimentalDecorators` option in `tsconfig.json` to be enabled.
213
205
@@ -349,7 +341,7 @@ Similar to object hooks, class hooks modify the class (or class prototype). Just
349
341
350
342
> __Note:__ Object or class level global hooks will only run if the method itself has been enabled for hooks. This can be done by registering hooks with an empty array.
351
343
352
-
#### Global Hooks - JavaScript Example
344
+
#### JavaScript Example
353
345
354
346
```js
355
347
const { hooks } =require('@feathersjs/hooks');
@@ -397,7 +389,7 @@ hooks(HelloSayer, {
397
389
})();
398
390
```
399
391
400
-
#### Global Hooks - TypeScript Example
392
+
#### TypeScript Example
401
393
402
394
Using decorators in TypeScript also respects inheritance:
403
395
@@ -830,6 +822,23 @@ const resolvers = {
830
822
}
831
823
```
832
824
825
+
# Contributing
826
+
827
+
For general contribution information refer to the [Feathers contribution guideLINES](https://github.com/feathersjs/hooks/blob/master/.github/contributing.md).
828
+
829
+
`@feathersjs/hooks` modules are written in TypeScript using [Deno](https://deno.land/) as the runtime. With Deno 1.16 or later installed you can start contributing by cloning this repository or your own fork via:
0 commit comments