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

Drop access to props.value to avoid bugs #121

Open
malte-wessel opened this issue May 14, 2019 · 0 comments
Open

Drop access to props.value to avoid bugs #121

malte-wessel opened this issue May 14, 2019 · 0 comments

Comments

@malte-wessel
Copy link
Contributor

Explain the problem

Right now it is possible the access the props' current value by calling props.value.
This might lead to bugs where a property is updated, but we still have an old reference to it.
We should find a way to deny access to this property.

// Dangerous!
const List = ({ props }) => {
    const { items } = props.value;
    return combine({
        items
    });
};

// Correct way
const List = ({ props }) => {
    const items = props.pipe(pluck('items'));
    return combine({
        items
    });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant