mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-07-06 01:00:37 +02:00
28 lines
491 B
JavaScript
28 lines
491 B
JavaScript
import Store from 'fluxible/addons/BaseStore';
|
|
|
|
class ViaPointStore extends Store {
|
|
static storeName = 'ViaPointStore';
|
|
|
|
viaPoints = [];
|
|
|
|
addViaPoint(val) {
|
|
this.viaPoints.push(val);
|
|
this.emitChange();
|
|
}
|
|
|
|
setViaPoints(viaPoints) {
|
|
this.viaPoints = [...viaPoints];
|
|
this.emitChange();
|
|
}
|
|
|
|
getViaPoints() {
|
|
return this.viaPoints;
|
|
}
|
|
|
|
static handlers = {
|
|
addViaPoint: 'addViaPoint',
|
|
setViaPoints: 'setViaPoints',
|
|
};
|
|
}
|
|
|
|
export default ViaPointStore;
|