Created
January 9, 2022 06:59
-
-
Save hieptlccc/260d21756cd3878fe032c2bbff014431 to your computer and use it in GitHub Desktop.
common.js - webex clone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { realTimeDb } from "../firebase"; | |
export const createCometChatGroup = async ({ cometChat, guid, name }) => { | |
const groupType = cometChat.GROUP_TYPE.PUBLIC; | |
const password = ""; | |
const group = new cometChat.Group(guid, name, groupType, password); | |
await cometChat.createGroup(group); | |
}; | |
export const showNotification = message => { | |
alert(message); | |
}; | |
export const insertFirebaseDatabase = async ({ key, id, payload }) => { | |
await realTimeDb.ref(`${key}/${id}`).set(payload); | |
}; | |
export const saveDataToLocalStorage = ({ key, payload }) => { | |
localStorage.setItem(key, payload); | |
}; | |
export const navigate = ({ route, push }) => { | |
push(route); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment