diff options
| author | cedricnjanga | 2017-10-06 11:50:05 +0200 | 
|---|---|---|
| committer | cedricnjanga | 2017-10-06 11:50:05 +0200 | 
| commit | c4362d355d6f3b2f407e8c51bb6c0bee43f39df3 (patch) | |
| tree | f6998aa0c07043f2b4b7aaf14d719831d05f1fd8 /app/javascript/vehicle_journeys/batch.js | |
| parent | b6f08e58fae35d5dd8a610af31c2950b37746695 (diff) | |
| download | chouette-core-c4362d355d6f3b2f407e8c51bb6c0bee43f39df3.tar.bz2 | |
Add vehicle journey app
Diffstat (limited to 'app/javascript/vehicle_journeys/batch.js')
| -rw-r--r-- | app/javascript/vehicle_journeys/batch.js | 26 | 
1 files changed, 26 insertions, 0 deletions
| diff --git a/app/javascript/vehicle_journeys/batch.js b/app/javascript/vehicle_journeys/batch.js new file mode 100644 index 000000000..ea08572aa --- /dev/null +++ b/app/javascript/vehicle_journeys/batch.js @@ -0,0 +1,26 @@ +// 'use strict'; + +// Object.defineProperty(exports, "__esModule", { +// 	value: true +// }); +// exports.batchActions = batchActions; +// exports.enableBatching = enableBatching; +// var BATCH = exports.BATCH = 'BATCH'; + +export function batchActions(actions) { +	return { +    type: 'BATCH', +    payload: actions +  }; +} + +export function enableBatching(reduce) { +	return function batchingReducer(state, action) { +		switch (action.type) { +			case 'BATCH': +				return action.payload.reduce(batchingReducer, state); +			default: +				return reduce(state, action); +		} +	} +}
\ No newline at end of file | 
