UNPKG

cosmo-ui

Version:
38 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var constants_1 = require("../constants"); exports.resetForm = function (formName) { return ({ type: constants_1.RESET_FORM, formName: formName }); }; exports.destroyForm = function (formName) { return ({ type: constants_1.DESTROY_FORM, formName: formName }); }; /** * Regith now there is abolutely no difference between submitFormValid * and submitFormInvalid. All they do is mark the form as submitted * However they may carry additional responsibility in the future * so i have created 2 separate actions * * @param formName * @param data * @param args */ exports.submitFormValid = function (formName, data, args) { return ({ type: constants_1.SUBMIT_FORM_VALID, formName: formName, data: data, args: args }); }; exports.submitFormInvalid = function (formName, data, args) { return ({ type: constants_1.SUBMIT_FORM_INVALID, formName: formName, data: data, args: args }); }; exports.setFormField = function (name, formName, field) { return ({ type: constants_1.SET_FORM_FIELD, name: name, formName: formName, field: field, }); }; exports.setAsyncFormField = function (name, formName, value) { return ({ type: constants_1.SET_ASYNC_FORM_FIELD, name: name, formName: formName, value: value, }); }; //# sourceMappingURL=form.js.map