Skip to content

Instantly share code, notes, and snippets.

View ls-joris-desmedt's full-sized avatar

Joris De Smedt ls-joris-desmedt

View GitHub Profile
import React from 'react';
import { FederatedProvider } from './federated-provider';
import { scopes } from './scopes';
// This is an example app on how you would setup your Nextjs app
const App = ({ Component }) => {
return (
<FederatedProvider scopes={scopes}>
<Component />
@ls-joris-desmedt
ls-joris-desmedt / echo-websocket.tsx
Created May 15, 2019 14:21
Websockets + React Context
import React, { ReactNode, useContext, useEffect, useState } from 'react';
import { Websocket } from './websocket';
export type EchoWebSocketContextType = [
(event: any, filter?: string) => void,
(event: any) => void
];
export const EchoWebSocketContext = React.createContext<EchoWebSocketContextType>([
() => {},
() => {},