@trippler/tr_lib 2.9.0 โ†’ 2.9.2

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 ADDED
@@ -0,0 +1,32 @@
1
+ # tr_lib
2
+
3
+ A lightweight utility & helper library for FiveM developers. Designed to improve code reusability, consistency, and performance across and outcross Trippler resources.
4
+
5
+ ![](https://img.shields.io/npm/d18m/%40trippler%2Ftr_lib)
6
+ ![](https://img.shields.io/npm/v/%40trippler%2Ftr_lib)
7
+
8
+ ## ๐Ÿ“ฅ Depend
9
+ ```json
10
+ "@trippler/tr_lib": "latest",
11
+ ```
12
+
13
+ ## ๐Ÿ“š Documentation
14
+ https://docs.trippler.store/tr_lib
15
+
16
+ ## GitHub
17
+ [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/TripplerScripts/tr_lib)
18
+
19
+ ## ๐Ÿ—บ๏ธ Roadmap
20
+ - [ ] add modules that serverify and clientify (asServer asClient)
21
+ - [ ] add client and server metadata communication module instead of heating events
22
+ - [ ] add controlled commands
23
+
24
+ ## ๐ŸงพLicense
25
+ [![](https://img.shields.io/npm/l/%40trippler%2Ftr_lib)](./LICENSE)
26
+
27
+ ## ๐Ÿ“ž Support
28
+ [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/vPwaW3rpUk)
29
+
30
+ ## ๐Ÿ’ป Build with
31
+ ![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
32
+ ![Lua](https://img.shields.io/badge/lua-%232C2D72.svg?style=for-the-badge&logo=lua&logoColor=white)
@@ -1,2 +1,2 @@
1
- declare const _default: (Function: () => void) => Promise<boolean>;
1
+ declare const _default: (Function: () => void) => Promise<unknown>;
2
2
  export default _default;
@@ -1,6 +1,11 @@
1
1
  import onNuiCallback from "../nuiCallback/onNuiCallback";
2
2
  let domLoaded = false;
3
- onNuiCallback('__DOMLoaded', () => domLoaded = true);
3
+ const waitingCallbacks = [];
4
+ onNuiCallback('__DOMLoaded', () => {
5
+ domLoaded = true;
6
+ waitingCallbacks.forEach(Function => Function());
7
+ waitingCallbacks.length = 0;
8
+ });
4
9
  export default (Function) => {
5
10
  return new Promise(resolve => {
6
11
  if (domLoaded) {
@@ -8,7 +13,7 @@ export default (Function) => {
8
13
  resolve(true);
9
14
  }
10
15
  else {
11
- onNuiCallback('__DOMLoaded', () => {
16
+ waitingCallbacks.push(() => {
12
17
  Function();
13
18
  resolve(true);
14
19
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trippler/tr_lib",
3
- "version": "2.9.0",
3
+ "version": "2.9.2",
4
4
  "description": "A lightweight utility & helper library for FiveM developers. Designed to improve code reusability, consistency, and performance across and outcross Trippler resources.",
5
5
  "author": "Trippler",
6
6
  "license": "GPL-3.0",
@@ -25,7 +25,7 @@
25
25
  "server",
26
26
  "shared",
27
27
  "web",
28
- "README.md"
28
+ "Readme.md"
29
29
  ],
30
30
  "scripts": {
31
31
  "patch": "npm run rebuild && npm version patch && npm publish",