@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 CHANGED
@@ -20,7 +20,7 @@ yarn add @armscye/hooks --dev
20
20
 
21
21
  ### ShutdownHook `Interface`
22
22
 
23
- Interface defining methods to respond to system signals (when application gets shutdown by, e.g., `SIGTERM`).
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 how hooks should be provided.
79
+ Describes type structure for hooks.
86
80
 
87
81
  ```ts
88
- type HookProvider<T = any> = string | symbol | object | Type<T> | Function;
82
+ type HookProvider = string | symbol | object | Type<any> | Function;
89
83
  ```
90
84
 
91
85
  ## License
@@ -1,2 +1,2 @@
1
1
  import { Type } from '@armscye/core';
2
- export type HookProvider<T = any> = string | symbol | object | Type<T> | Function;
2
+ export type HookProvider = string | symbol | object | Type<any> | Function;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Interface defining methods to respond to system signals (when application gets
2
+ * Interface defining method to respond to system signals (when application gets
3
3
  * shutdown by, e.g., `SIGTERM`).
4
4
  */
5
5
  export interface ShutdownHook {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armscye/hooks",
3
- "version": "0.6.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.3.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": "a26e3829ccbd43eae0ab1a1dd165af7ae7b355c1"
31
+ "gitHead": "0709eb7276b853296ef820d0e5bd8c170e6d2ee3"
32
32
  }