Skip to content

Instantly share code, notes, and snippets.

View adnaan's full-sized avatar
🎯
Focusing

Adnaan Badr adnaan

🎯
Focusing
View GitHub Profile
@adnaan
adnaan / centrifuge-react-native.jsx
Last active August 16, 2021 13:53
Centrifuge Client example for react native
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Centrifuge from 'centrifuge';
export default class App extends React.Component {
componentDidMount() {
console.log("componentDidMount")
var timestamp = Math.floor(Date.now() / 1000);
var centrifuge = new Centrifuge({
{
"labels": ["January", "February"],
"datasets": [{
"label": "Data One",
"backgroundColor": "#f87979",
"data": [40, 20]
}]
}
import {createSlice} from "@reduxjs/toolkit";
import {asyncThunk, rx, asyncAction} from "./thunks";
import {identity} from "./identity";
export const fetchAccount = asyncThunk(
"account",
"fetchAccount",
async (id, state) => {
return identity.currentUser().attributes();
});