|
|
@ -6,7 +6,8 @@ let stateCache = {};
|
|
|
|
|
|
|
|
|
|
|
|
type Constructor<T> = new(...args: any[]) => T;
|
|
|
|
type Constructor<T> = new(...args: any[]) => T;
|
|
|
|
|
|
|
|
|
|
|
|
export function historyPersistor<T extends Constructor<React.Component>>(Base: T, tag: string) {
|
|
|
|
export function historyPersistor(tag: string) {
|
|
|
|
|
|
|
|
return function<T extends Constructor<React.Component>>(Base: T) {
|
|
|
|
return withRouter(class extends Base {
|
|
|
|
return withRouter(class extends Base {
|
|
|
|
constructor(...rest: any[]) {
|
|
|
|
constructor(...rest: any[]) {
|
|
|
|
const props = rest[0];
|
|
|
|
const props = rest[0];
|
|
|
@ -28,4 +29,5 @@ export function historyPersistor<T extends Constructor<React.Component>>(Base: T
|
|
|
|
return props.location.pathname + ':' + tagName;
|
|
|
|
return props.location.pathname + ':' + tagName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|