history
This commit is contained in:
6
src/history.ts
Normal file
6
src/history.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { createBrowserHistory } from 'history'
|
||||
|
||||
|
||||
const history = createBrowserHistory();
|
||||
|
||||
export default history;
|
||||
@@ -3,9 +3,9 @@ import "systemjs/dist/extras/amd";
|
||||
import "systemjs/dist/extras/named-register";
|
||||
import "systemjs/dist/extras/named-exports";
|
||||
import "systemjs/dist/extras/transform";
|
||||
import { createBrowserHistory } from 'history'
|
||||
import { Apps } from './apps'
|
||||
import { defineVirtualModule } from './virtual-module'
|
||||
import history from './history';
|
||||
|
||||
const systemJSImport = async (requestUrl: string) => {
|
||||
const { default: component, mount, unmount } = await System.import(
|
||||
@@ -19,8 +19,6 @@ export default async ({ apps: rawApps, navigations, config, features }) => {
|
||||
|
||||
const apps = new Apps(rawApps)
|
||||
|
||||
const history = createBrowserHistory()
|
||||
|
||||
let prevPathname = window.location.pathname
|
||||
|
||||
async function getApp() {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import history from './history';
|
||||
|
||||
const createVirtualModule = ({ config, navigations, features }) => ({
|
||||
getConfig: () => config,
|
||||
getConfigValue: (pkg: string) => config[pkg],
|
||||
getNavigations: () => navigations,
|
||||
getNavigationsValue: (pkg: string) => navigations[pkg],
|
||||
getAllFeatures: () => features,
|
||||
getFeatures: (pkg: string) => features[pkg]
|
||||
getFeatures: (pkg: string) => features[pkg],
|
||||
getHistory: () => history,
|
||||
})
|
||||
|
||||
export const defineVirtualModule = (params) => {
|
||||
|
||||
Reference in New Issue
Block a user