mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-25 19:48:42 +03:00
Clean master commit
This commit is contained in:
25
src/reducers/domain.js
Normal file
25
src/reducers/domain.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import initial from '../store/initial.js';
|
||||
|
||||
import {
|
||||
UPDATE_DOMAIN,
|
||||
} from '../actions';
|
||||
|
||||
import { parseDateTimes } from './utils/helpers.js';
|
||||
import { validate } from './utils/validators.js';
|
||||
|
||||
function updateDomain(domainState, action) {
|
||||
action.domain.events = parseDateTimes(action.domain.events);
|
||||
|
||||
return Object.assign({}, domainState, validate(action.domain));
|
||||
}
|
||||
|
||||
function domain(domainState = initial.domain, action) {
|
||||
switch (action.type) {
|
||||
case UPDATE_DOMAIN:
|
||||
return updateDomain(domainState, action);
|
||||
default:
|
||||
return domainState;
|
||||
}
|
||||
}
|
||||
|
||||
export default domain;
|
||||
Reference in New Issue
Block a user