feat(resources/cl_utils): NuiCallback

This commit is contained in:
Christopher committed 2021-03-22 22:45:47 +01:00
1 parent 4e7e6b3e92
commit b42ee97450
1 file changed
+7
+7
View File
@@ -52,3 +52,10 @@ export default class ClientUtils {
});
}
}
export const NuiCallback = (event: string, callback: Function) => {
RegisterRawNuiCallback(event, (data: any) => {
const parsed = JSON.parse(data?.body);
callback(parsed);
});
};