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 GroupsProvider from '../state/GroupsProvider';
import NotificationsProvider from '../state/Notifications/NotificationsProvider'; import NotificationsProvider from '../state/Notifications/NotificationsProvider';
import { useMe } from './hooks'; import { useMe } from './hooks';
import useImmutable from './useImmutable';
import WheelShare from './WheelShare'; import WheelShare from './WheelShare';
import WheelShareLoggedOut from './WheelShareLoggedOut'; import WheelShareLoggedOut from './WheelShareLoggedOut';
@ -24,20 +23,12 @@ const style: CSSProperties = {
export default function App() { export default function App() {
const user = useMe(); const user = useMe();
const [imm] = useImmutable({
x: 0,
y: 0,
z: { a: 1, b: 2, c: [0, 1, 2] },
});
return ( return (
<NotificationsProvider> <NotificationsProvider>
<GroupsProvider> <GroupsProvider>
<div style={{ padding: '1rem', maxWidth: '100vw' }}> <div style={{ padding: '1rem', maxWidth: '100vw' }}>
<div style={style}> <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> <BrowserRouter>
<Switch> <Switch>
<Route <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>
);
}