Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { createRouteBundle, createSelector } from 'redux-bundler';
import loadable from '@/utils/loadable';
const bundle = createRouteBundle({
'/': {
name: 'Home',
C: loadable(() => import('@/pages/Home')),
},
'/about': {
name: 'About',
C: loadable(() => import('@/pages/About')),
},
'*': {
name:'NotFound',
C: loadable(() => import('@/pages/NotFound')),
},
});
bundle.selectRouteName = createSelector(
import { createRouteBundle, createSelector } from 'redux-bundler'
import PAGES from '../constants/pages'
import Page from '../page/Page'
const bundle = createRouteBundle({
'/:hash': Page,
'/add/:hash': Page,
'*': Page
}, { routeInfoSelector: 'selectHash' })
bundle.selectCurrentPage = createSelector(
'selectRouteInfo',
({ url, params }) => (url.startsWith('/add') || !params.hash) ? PAGES.add : PAGES.download
)
export default bundle