@armscye/hooks 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -9
- package/dist/hook-provider.d.ts +1 -1
- package/dist/shutdown-hook.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ yarn add @armscye/hooks --dev
|
|
|
20
20
|
|
|
21
21
|
### ShutdownHook `Interface`
|
|
22
22
|
|
|
23
|
-
Interface defining
|
|
23
|
+
Interface defining method to respond to system signals (when application gets shutdown by, e.g., `SIGTERM`).
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
interface ShutdownHook {
|
|
@@ -46,9 +46,6 @@ class MyShutdownHook implements ShutdownHook {
|
|
|
46
46
|
.catch(error => console.error("Error closing database:", error));
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
// Register the shutdown hook with the application
|
|
51
|
-
app.registerHook(new MyShutdownHook())
|
|
52
49
|
```
|
|
53
50
|
|
|
54
51
|
### StartupHook `Interface`
|
|
@@ -75,17 +72,14 @@ class MyStartupHook implements StartupHook {
|
|
|
75
72
|
console.log('Database connection established.');
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
|
-
|
|
79
|
-
// Register the startup hook with the application
|
|
80
|
-
app.registerHook(new MyStartupHook());
|
|
81
75
|
```
|
|
82
76
|
|
|
83
77
|
### HookProvider `Type`
|
|
84
78
|
|
|
85
|
-
Describes
|
|
79
|
+
Describes type structure for hooks.
|
|
86
80
|
|
|
87
81
|
```ts
|
|
88
|
-
type HookProvider
|
|
82
|
+
type HookProvider = string | symbol | object | Type<any> | Function;
|
|
89
83
|
```
|
|
90
84
|
|
|
91
85
|
## License
|
package/dist/hook-provider.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Type } from '@armscye/core';
|
|
2
|
-
export type HookProvider
|
|
2
|
+
export type HookProvider = string | symbol | object | Type<any> | Function;
|
package/dist/shutdown-hook.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armscye/hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A collection of shared standard TypeScript definitions (@hooks)",
|
|
5
5
|
"author": "Augustus Kamau",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"hooks"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@armscye/core": "^0.
|
|
18
|
+
"@armscye/core": "^0.4.0"
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/armscye/armscye#readme",
|
|
21
21
|
"repository": {
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "0709eb7276b853296ef820d0e5bd8c170e6d2ee3"
|
|
32
32
|
}
|