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

Immutable props #184

@mpal9000

Description

@mpal9000

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions