Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Add "ensureBinding" Function To Binding API #311

Open
The-Big-Bird opened this issue Jun 14, 2021 · 0 comments
Open

Add "ensureBinding" Function To Binding API #311

The-Big-Bird opened this issue Jun 14, 2021 · 0 comments

Comments

@The-Big-Bird
Copy link

The-Big-Bird commented Jun 14, 2021

Problem

Currently, when accepting values & bindings interchangeably under the same prop; we're forced to write two different types of logic for the same prop and it's near-impossible to join several of these props together externally.

image
(Example of hacky solution to allow for the "map" method to be used regardless of prop type.)

Solution

Add a function to the binding API to ensure a prop is given the same behavior and methods as a binding if it isn't a binding already.

Benefits

This would allow for both values and bindings to be passed under the same prop without having to code in hacky binding type checks with separate behavior.
This would also allow for these aforementioned props to be joined together and behave as expected regardless of which of them are passed in as bindings.

Non-binding prop values that are assigned binding behavior under this function could have their internal subscription behavior removed as to not add extra unnecessary performance hits.

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