working client/server intaction

This commit is contained in:
erik-sn committed 2020-10-12 01:03:16 -04:00
1 parent c19d0ee3aa
commit 2920267ef3
8 files changed
+99 -58

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
export default {
TWITTER: 'TWITTER',
}
+5
View File
@@ -0,0 +1,5 @@
export default {
TWITTER_FETCH_TWEETS: 'phone:fetchTweets',
TWITTER_FETCH_TWEETS_SUCCESS: 'fetchTweets',
TWITTER_FETCH_TWEETS_FAILURE: 'fetchTweetsFailed',
}
+13
View File
@@ -0,0 +1,13 @@
import apps from './apps';
function sendMessage(app: string, method: string, data: any) {
return SendNuiMessage(JSON.stringify({
app,
method,
data,
}))
}
export function sendTwitterMessage(method: string, data: any = {}) {
return sendMessage(apps.TWITTER, method, data);
}