forked from geosolutions-it/MapStoreExtension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converting extension to use dynamic import by default (module plugin …
…mode), updating upstream to the latest master branch (geosolutions-it#36)
- Loading branch information
1 parent
0dc86d2
commit 1a0db76
Showing
4 changed files
with
56 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,4 @@ | ||
import {connect} from "react-redux"; | ||
import { name } from '../../../config'; | ||
import {toModulePlugin} from "@mapstore/utils/ModulePluginsUtils"; | ||
import {name} from "../../../config"; | ||
|
||
import ExtensionComponent from "../components/Component"; | ||
import Rx from "rxjs"; | ||
import { changeZoomLevel } from "@mapstore/actions/map"; | ||
|
||
import '../assets/style.css'; | ||
export default { | ||
name, | ||
component: connect(state => ({ | ||
value: state.sampleExtension && state.sampleExtension.value | ||
}), { | ||
onIncrease: () => { | ||
return { | ||
type: 'INCREASE_COUNTER' | ||
}; | ||
}, changeZoomLevel | ||
})(ExtensionComponent), | ||
reducers: { | ||
sampleExtension: (state = { value: 1 }, action) => { | ||
if (action.type === 'INCREASE_COUNTER') { | ||
return { value: state.value + 1 }; | ||
} | ||
return state; | ||
} | ||
}, | ||
epics: { | ||
logCounterValue: (action$, store) => action$.ofType('INCREASE_COUNTER').switchMap(() => { | ||
/* eslint-disable */ | ||
console.log('CURRENT VALUE: ' + store.getState().sampleExtension.value); | ||
/* eslint-enable */ | ||
return Rx.Observable.empty(); | ||
}) | ||
}, | ||
containers: { | ||
Toolbar: { | ||
name: "sampleExtension", | ||
position: 10, | ||
text: "INC", | ||
doNotHide: true, | ||
action: () => { | ||
return { | ||
type: 'INCREASE_COUNTER' | ||
}; | ||
}, | ||
priority: 1 | ||
} | ||
} | ||
}; | ||
export default toModulePlugin(name, () => import(/* webpackChunkName: 'extension' */ './Module')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import {connect} from "react-redux"; | ||
import { name } from '../../../config'; | ||
|
||
import {createPlugin} from "@mapstore/utils/PluginsUtils"; | ||
import ExtensionComponent from "../components/Component"; | ||
import Rx from "rxjs"; | ||
|
||
import { changeZoomLevel } from "@mapstore/actions/map"; | ||
import '../assets/style.css'; | ||
|
||
export default createPlugin(name, { | ||
component: connect(state => ({ | ||
value: state.sampleExtension && state.sampleExtension.value | ||
}), { | ||
onIncrease: () => { | ||
return { | ||
type: 'INCREASE_COUNTER' | ||
}; | ||
}, changeZoomLevel | ||
})(ExtensionComponent), | ||
reducers: { | ||
sampleExtension: (state = { value: 1 }, action) => { | ||
if (action.type === 'INCREASE_COUNTER') { | ||
return { value: state.value + 1 }; | ||
} | ||
return state; | ||
} | ||
}, | ||
epics: { | ||
logCounterValue: (action$, store) => action$.ofType('INCREASE_COUNTER').switchMap(() => { | ||
/* eslint-disable */ | ||
console.log('CURRENT VALUE: ' + store.getState().sampleExtension.value); | ||
/* eslint-enable */ | ||
return Rx.Observable.empty(); | ||
}) | ||
}, | ||
containers: { | ||
Toolbar: { | ||
name: "sampleExtension", | ||
position: 10, | ||
text: "INC", | ||
doNotHide: true, | ||
action: () => { | ||
return { | ||
type: 'INCREASE_COUNTER' | ||
}; | ||
}, | ||
priority: 1 | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters