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

Do not update group value property when the change action is triggered #66

Closed
wants to merge 1 commit into from

Conversation

Artmann
Copy link

@Artmann Artmann commented Oct 10, 2017

This is a breaking change as it will modify the behaviour of the component.

Do not update the group value when the change action is triggered as it violates "Data Down, Actions Up".

{{#radio-button
	value="blue"
	groupValue=color
	changed=(action (mut color))}}
	Blue
{{/radio-button}}

Fixes #16

**This is a breaking change as it will modify the behaviour of the component.**

Do not update the group value when the change action is triggered as it violates "Data Down, Actions Up".

```
{{#radio-button
	value="blue"
	groupValue=color
	changed=(action (mut color))}}
	Blue
{{/radio-button}}
```

Fixes yapplabs#32
@raycohen
Copy link
Contributor

as mentioned in #16 (comment) I don't believe DDAU works well in this case because it allows the data layer to get out of sync with what the page is displaying.

@Artmann
Copy link
Author

Artmann commented Oct 11, 2017

Is'nt that a generic feature of DDAU? If you don't mutate your state correctly, stuff is going to break.

@raycohen
Copy link
Contributor

raycohen commented Oct 11, 2017

normally if you don't mutate your state, your UI will just show the existing state.

in this case, the user interaction will change the radio's state in the DOM. if you choose not to update your state (or forget), your state will think the value is off but the page is displaying it as on (or vice-versa)

imagine if you instead created a radio button component that did not use the input type=radio element, but rather just divs and images/css. then with DDAU if you don't mutate your state, the page will not change what the user sees.

@raycohen
Copy link
Contributor

closing as this has gotten stale. please continue any discussion of DDAU in #16

@raycohen raycohen closed this Feb 20, 2018
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