remove useimmutable demo from homepage

This commit is contained in:
Michael Fatemi 2021-07-15 11:02:55 -04:00
parent 25e7c08605
commit 7acfa610cb
2 changed files with 19 additions and 10 deletions

View File

@ -3,7 +3,6 @@ import { BrowserRouter, Route, Switch } from 'react-router-dom';
import GroupsProvider from '../state/GroupsProvider';
import NotificationsProvider from '../state/Notifications/NotificationsProvider';
import { useMe } from './hooks';
import useImmutable from './useImmutable';
import WheelShare from './WheelShare';
import WheelShareLoggedOut from './WheelShareLoggedOut';
@ -24,20 +23,12 @@ const style: CSSProperties = {
export default function App() {
const user = useMe();
const [imm] = useImmutable({
x: 0,
y: 0,
z: { a: 1, b: 2, c: [0, 1, 2] },
});
return (
<NotificationsProvider>
<GroupsProvider>
<div style={{ padding: '1rem', maxWidth: '100vw' }}>
<div style={style}>
{JSON.stringify(imm)}
{/* Reset button */}
<button onClick={() => imm.z.a++}>Increment</button>
<button onClick={() => imm.z.c.push(imm.z.c.length)}>Push</button>
<BrowserRouter>
<Switch>
<Route

View File

@ -0,0 +1,18 @@
import useImmutable from './useImmutable';
export default function UseImmutableTest() {
const [imm] = useImmutable({
x: 0,
y: 0,
z: { a: 1, b: 2, c: [0, 1, 2] },
});
return (
<div>
{JSON.stringify(imm)}
Reset button
<button onClick={() => imm.z.a++}>Increment</button>
<button onClick={() => imm.z.c.push(imm.z.c.length)}>Push</button>
</div>
);
}