Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {createFarceRouter, createRender, makeRouteConfig, Route,} from 'found';
import {Resolver} from 'found-relay';
import FrontPage from './pages/FrontPage';
import Profile, {ProfileQuery, render as ProfileRender} from "./pages/Profile";
import KitchenSink from "./pages/KitchenSink";
import Dash from "./pages/Dash";
import Theme from "./Theme";
import Settings from "./pages/Settings";
import Profiles from "./pages/Profiles";
import './App.css';
import store from "./local-storage";
const Router = createFarceRouter({
historyProtocol: new BrowserProtocol(),
historyMiddlewares: [queryMiddleware],
routeConfig: makeRouteConfig(
params} query={ProfileQuery}
render={ProfileRender}/>
),
render: createRender({}),
});
if (!store.value.profile)
import { MainPage } from './MainPage';
import { WidgetsPage } from './WidgetsPage';
const fetchWidget = (widgetId: any) =>
new Promise(resolve => {
throw new Error('oops');
});
const fetchWidgets = ({ params, context }: RouteMatch) => [
'foo',
'bar',
'baz',
];
const BrowserRouter = createBrowserRouter({
routeConfig: makeRouteConfig(
import('./WidgetsPage').then(module => module.WidgetsPage)
}
getData={({ params: { widgetId } }) =>
fetchWidget(widgetId).catch(() => {
throw new HttpError(404);
})
}
render={({ Component, props }) =>
Component && props ? (