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

Stateful binding handlers/constructors #1602

Open
brianmhunt opened this issue Nov 6, 2014 · 1 comment
Open

Stateful binding handlers/constructors #1602

brianmhunt opened this issue Nov 6, 2014 · 1 comment

Comments

@brianmhunt
Copy link
Member

A common pair of problems across both internal and custom binding handlers seems to be:

  1. Re-using information, which is generally handled with a closure in the bindingHandler init, as in textInput, value and others; and
  2. Extending the functionality of core bindings, as in How to create one way (from view to datasource) textInput binding? #1601.

I have a relatively thorough comment on that issue, but the gist is to add allow Knockout to take bindingHandlers that are constructors.

I am likely missing something fairly important, but the key to this would seem to be in bindingAttributeSyntax

I am confident this could be done in a backward compatible way.

I will look at this more later, but would of course love thoughts on this.

@mbest
Copy link
Member

mbest commented Nov 7, 2014

Concerning the issues that have come up about extending binding handlers, I had a different idea: #663.

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

3 participants