Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand injector form API to be more state aware with FormStateManager #175

Conversation

unclecheese
Copy link

@unclecheese unclecheese force-pushed the pulls/1.0/injector-form-state-awareness branch from b299ee2 to dbf7b80 Compare July 31, 2017 23:35
*/
mutateField(fieldName, updater) {
const fieldList = this.schemaState.fields || [];
const fieldList = this.schema.state.fields || [];
const fieldIndex = fieldList.findIndex(field => field.name === fieldName);
if (fieldIndex < 0) {
return this;
}
const field = fieldList[fieldIndex];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noticed this should be { ...fieldList[fieldIndex] } or below have updater({ ...field }) in case of mutations in the updater()

*/
constructor(schemaState) {
this.schemaState = { ...schemaState };
constructor(schema, reduxFormState) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing JSDoc for reduxFormState

@flamerohr flamerohr merged commit 5eaa563 into silverstripe:1 Aug 1, 2017
@flamerohr flamerohr deleted the pulls/1.0/injector-form-state-awareness branch August 1, 2017 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants