src/index.js
function cloneStateDef(stateDef) {
    stateDef = (stateDef || {});
    return function () {
        var ctx = this;
        return Object.keys(stateDef).reduce((state, k) => {
            var value = stateDef[k];
            state[k] = (typeof value === 'function' ? value.call(ctx) : value);
            return state;
        }, {});
    };
}
function cloneStateDef(stateDef) {
    stateDef = (stateDef || {});
    return function () {
        var ctx = this;
        return Object.keys(stateDef).reduce((state, k) => {
            var value = stateDef[k];
            state[k] = (typeof value === 'function' ? value.call(ctx) : value);
            return state;
        }, {});
    };
}
function cloneStateDef ( stateDef ) { stateDef = ( stateDef || { } ) ; return function ( ) { var ctx = this ; return Object . keys ( stateDef ) . reduce ( ( state , k ) => { var value = stateDef [ k ] ; state [ k ] = ( typeof value === 'function' ? value . call ( ctx ) : value ) ; return state ; } , { } ) ; } ; }
Returns a function that returns a clone of the object passed to it initially
Returns a function that returns a clone of the object passed to it initially