UNPKG

redux-form

Version:

A higher order component decorator for forms using Redux and React

23 lines (21 loc) 703 B
import _extends from "@babel/runtime/helpers/extends"; import { connect } from 'react-redux'; export default function createValues(_ref) { var getIn = _ref.getIn; return function (config) { var _prop$getFormState$co = _extends({ prop: 'values', getFormState: function getFormState(state) { return getIn(state, 'form'); } }, config), form = _prop$getFormState$co.form, prop = _prop$getFormState$co.prop, getFormState = _prop$getFormState$co.getFormState; return connect(function (state) { var _ref2; return _ref2 = {}, _ref2[prop] = getIn(getFormState(state), form + ".values"), _ref2; } // ignore dispatch ); }; }