@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 +32 -0
- package/client/dom/index.d.ts +1 -1
- package/client/dom/index.js +7 -2
- package/package.json +2 -2
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
|
+

|
|
6
|
+

|
|
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
|
+
[](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
|
+
[](./LICENSE)
|
|
26
|
+
|
|
27
|
+
## ๐ Support
|
|
28
|
+
[](https://discord.gg/vPwaW3rpUk)
|
|
29
|
+
|
|
30
|
+
## ๐ป Build with
|
|
31
|
+

|
|
32
|
+

|
package/client/dom/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (Function: () => void) => Promise<
|
|
1
|
+
declare const _default: (Function: () => void) => Promise<unknown>;
|
|
2
2
|
export default _default;
|
package/client/dom/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import onNuiCallback from "../nuiCallback/onNuiCallback";
|
|
2
2
|
let domLoaded = false;
|
|
3
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
"
|
|
28
|
+
"Readme.md"
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
31
|
"patch": "npm run rebuild && npm version patch && npm publish",
|