Comparing version 3.0.0 to 4.0.0
@@ -30,3 +30,3 @@ 'use strict'; | ||
var canceled = _getActionCreators.canceled; | ||
var failed = _getActionCreators.failed; | ||
var validationFailed = _getActionCreators.validationFailed; | ||
var focused = _getActionCreators.focused; | ||
@@ -43,3 +43,3 @@ var blurred = _getActionCreators.blurred; | ||
change: [changed, saved, canceled], | ||
fail: failed, | ||
fail: validationFailed, | ||
focus: focused, | ||
@@ -64,2 +64,4 @@ blur: blurred | ||
var form = null; | ||
// getProps takes some state and merges it with the store's state | ||
@@ -69,22 +71,26 @@ // this is so you can pass in state during render time and have it be picked | ||
var getProps = function getProps(state) { | ||
return (0, _fluxForm2['default'])(namespace, { | ||
dispatch: function dispatch(res) { | ||
var _res$meta = res.meta; | ||
var namespace = _res$meta.namespace; | ||
var name = _res$meta.name; | ||
var details = { | ||
id: res.type, | ||
namespace: namespace, | ||
name: name | ||
}; | ||
alt.dispatch(res.type, res.payload, details); | ||
} | ||
}, _extends({}, opts, { | ||
form = (0, _fluxForm2['default'])(namespace, alt, _extends({}, opts, { | ||
state: _extends({}, state, store.getState().state) | ||
})); | ||
return form; | ||
}; | ||
return { store: store, state: state, getProps: getProps }; | ||
var validate = function validate(cb, v) { | ||
return form ? form.validate(cb, v) : Promise.reject(); | ||
}; | ||
var save = function save(cb) { | ||
return form ? form.save(cb) : Promise.reject(); | ||
}; | ||
var normalize = function normalize() { | ||
return form ? form.normalize() : null; | ||
}; | ||
return { | ||
store: store, | ||
state: state, | ||
getProps: getProps, | ||
validate: validate, | ||
save: save | ||
}; | ||
}; |
{ | ||
"name": "alt-form", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Manage your forms with alt", | ||
"main": "lib/altForm.js", | ||
"dependencies": { | ||
"flux-form": "3.0.0" | ||
"flux-form": "4.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
4228
75
+ Addedcreate-actions@2.0.0(transitive)
+ Addedflux-form@4.1.0(transitive)
- Removedflux-form@3.0.0(transitive)
Updatedflux-form@4.1.0