Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Immutable props #184

Open
mpal9000 opened this issue Sep 22, 2015 · 0 comments
Open

Immutable props #184

mpal9000 opened this issue Sep 22, 2015 · 0 comments

Comments

@mpal9000
Copy link

What is the prefered way to handle transparently or with minimal boilerplate immutable props in mercury? By props I mean an object that you provide to the render function of a descendant component, so you can affect it without touching its state from the owner. I can always use separate arguments, but I prefer an object, because usually there are more than one or two values and also I like to mimic the h() api. A not pretty way is to use a memoized function, with a single cache "slot", which will return the props object, based on some primitive arguments. That is ok for the descendant which will receive the object argument, but not even close to transparent for the owner component. By transparent I mean at the level of how we handle/embed state.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant