annotate client/src/identify/store.js @ 975:3da707172772

refac: removed technical debt Cleaned up mapstore to adhere more to Single Repsonsibility Principle (SRP)
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 18 Oct 2018 16:47:17 +0200
parents
children ca628dce90dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
975
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 // note that some identified features may not have an id
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 // especially related to drawing in our own vector layer
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
4 const IndentifyStore = {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 namespaced: true,
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6 state: {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7 identifiedFeatures: [],
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
8 currentMeasurement: null
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
9 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
10 getters: {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
11 identifiedFeatures: state => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
12 return state.identifiedFeatures;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
13 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 currentMeasurement: state => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 return state.currentMeasurement;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
16 }
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
17 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 mutations: {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
19 setIdentifiedFeatures: (state, identifiedFeatures) => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
20 state.identifiedFeatures = identifiedFeatures;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
21 },
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
22 setCurrentMeasurement: (state, measurement) => {
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 state.currentMeasurement = measurement;
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
24 }
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
25 }
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 };
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27
3da707172772 refac: removed technical debt
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
28 export default IndentifyStore;