-
Notifications
You must be signed in to change notification settings - Fork 383
/
version.js
44 lines (40 loc) · 914 Bytes
/
version.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Copyright 2017, GeoSolutions Sas.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
import { CHANGE_VERSION, LOAD_VERSION_ERROR } from '../actions/version';
import assign from 'object-assign';
/**
* Manages the state of the version identifier
* @prop {string} current version identifier
*
* @example
*{
* current: '2017.00.04'
*}
* @memberof reducers
*/
function version(state = null, action) {
switch (action.type) {
case CHANGE_VERSION: {
return assign({}, state,
{
current: action.version
}
);
}
case LOAD_VERSION_ERROR: {
return assign({}, state,
{
current: 'no-version'
}
);
}
default:
return state;
}
}
export default version;