UNPKG

fetch-xl

Version:

Fluent, interceptable (using es6 generators), configurable and loggable fetch wrapper

18 lines (14 loc) 340 B
import is from './is'; const action = (type, payload, ...extraKeyValueArrays) => { const actionObj = { type, payload }; if (is.set(extraKeyValueArrays)) { extraKeyValueArrays.forEach(([key, val]) => { actionObj[key] = val; }); } return actionObj; }; export default action;