Skip to content

Instantly share code, notes, and snippets.

@hieptlccc
Created January 9, 2022 06:59
Show Gist options
  • Save hieptlccc/260d21756cd3878fe032c2bbff014431 to your computer and use it in GitHub Desktop.
Save hieptlccc/260d21756cd3878fe032c2bbff014431 to your computer and use it in GitHub Desktop.
common.js - webex clone
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