Created
May 9, 2018 18:27
-
-
Save anu1097/736dea941d97b8a279f2dd2b200cdeec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | |
import createIsPristine from './isPristine'; | |
var createIsDirty = function createIsDirty(structure) { | |
return function (form, getFormState) { | |
var isPristine = createIsPristine(structure)(form, getFormState); | |
return function (state) { | |
for (var _len = arguments.length, fields = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | |
fields[_key - 1] = arguments[_key]; | |
} | |
return !isPristine.apply(undefined, [state].concat(_toConsumableArray(fields))); | |
}; | |
}; | |
}; | |
export default createIsDirty; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment