How to use the redux-bundler.createRouteBundle function in redux-bundler

To help you get started, we’ve selected a few redux-bundler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dwarvesf / template-react-app / template / src / bundles / routes.js View on Github external
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(
github ipfs-shipyard / ipfs-share-files / src / bundles / routes.js View on Github external
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