feat(resource): messageEvent for each app

This commit is contained in:
Christopher committed 2021-03-15 10:52:11 +01:00
1 parent 4045acc162
commit 5c9f36f754
2 files changed
+16 -1

No files matched your search

+3
View File
@@ -2,4 +2,7 @@ export default {
TWITTER: 'TWITTER',
MESSAGES: 'MESSAGES',
NOTES: 'NOTES',
MARKETPLACE: 'SELLOUT',
CONTACTS: 'CONTACTS',
CAMERA: 'CAMERA',
};
+13 -1
View File
@@ -1,6 +1,6 @@
import apps from './apps';
function sendMessage(app: string, method: string, data: any) {
export function sendMessage(app: string, method: string, data: any) {
return SendNuiMessage(
JSON.stringify({
app,
@@ -21,3 +21,15 @@ export function sendMessageEvent(method: string, data: any = {}) {
export function sendNotesEvent(method: string, data: any = {}) {
return sendMessage(apps.NOTES, method, data);
}
export function sendMarketplaceEvent(method: string, data: any = {}) {
sendMessage(apps.MARKETPLACE, method, data);
}
export function sendContactsEvent(method: string, data: any = {}) {
sendMessage(apps.CONTACTS, method, data);
}
export function sendCameraEvent(method: string, data: any = {}) {
sendMessage(apps.CAMERA, method, data);
}