Skip to content

Instantly share code, notes, and snippets.

@anu1097
Created May 9, 2018 18:28
Show Gist options
  • Save anu1097/c52d91a239b9bcf1bd072076f5d13383 to your computer and use it in GitHub Desktop.
Save anu1097/c52d91a239b9bcf1bd072076f5d13383 to your computer and use it in GitHub Desktop.
var createIsPristine = function createIsPristine(_ref) {
var deepEqual = _ref.deepEqual,
empty = _ref.empty,
getIn = _ref.getIn;
return function (form, getFormState) {
return function (state) {
var nonNullGetFormState = getFormState || function (state) {
return getIn(state, 'form');
};
var formState = nonNullGetFormState(state);
var initial = getIn(formState, form + '.initial') || empty;
var values = getIn(formState, form + '.values') || initial;
return deepEqual(initial, values);
};
};
};
export default createIsPristine;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment