Comparing version 1.0.4 to 1.1.0
@@ -15,2 +15,8 @@ 'use strict'; | ||
var isRequired = function isRequired(data) { | ||
if (!data) throw new Error('Field is required'); | ||
}; | ||
exports.isRequired = isRequired; | ||
exports['default'] = function (namespace, alt, opts) { | ||
@@ -24,10 +30,18 @@ var state = opts.state || {}; | ||
var canceled = _getActionCreators.canceled; | ||
var failed = _getActionCreators.failed; | ||
var store = alt.createUnsavedStore({ | ||
state: state, | ||
state: { | ||
errors: null, | ||
state: state | ||
}, | ||
bindListeners: { | ||
change: [changed.id, saved.id, canceled.id] | ||
change: [changed, saved, canceled], | ||
fail: failed | ||
}, | ||
fail: function fail(invalidState) { | ||
this.setState({ errors: invalidState }); | ||
}, | ||
change: function change(state) { | ||
this.setState(state); | ||
this.setState({ errors: null, state: state }); | ||
} | ||
@@ -41,3 +55,3 @@ }); | ||
return (0, _fluxForm2['default'])(namespace, alt.dispatcher, _extends({}, opts, { | ||
state: _extends({}, state, store.getState()) | ||
state: _extends({}, state, store.getState().state) | ||
})); | ||
@@ -47,4 +61,2 @@ }; | ||
return { store: store, state: state, getProps: getProps }; | ||
}; | ||
module.exports = exports['default']; | ||
}; |
{ | ||
"name": "alt-form", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Manage your forms with alt", | ||
"main": "lib/altForm.js", | ||
"dependencies": { | ||
"flux-form": "1.0.2" | ||
"flux-form": "1.1.0" | ||
}, | ||
@@ -9,0 +9,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3452
44
+ Addedflux-form@1.1.0(transitive)
- Removedflux-form@1.0.2(transitive)
Updatedflux-form@1.1.0