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

ViewModel string binding syntax? #65

Closed
wants to merge 1 commit into from
Closed

Conversation

joshski
Copy link
Member

@joshski joshski commented Feb 6, 2017

Not ready to merge, posting this for feedback.

Since we are deprecating render functions, we should mostly be able to lose the weird [model, 'property'] binding syntax in favour of just 'property', because ViewModels are usually binding to this, e.g:

// instead of:
class ViewModel {
  render() {
    return h('input', { type: 'text', binding: [this, 'text'] })
  }
}

// ...can we do this now?
class ViewModel {
  render() {
    return h('input', { type: 'text', binding: 'text' })
  }
}

Wrote a failing test but got a bit lost trying to make it pass :) -- what do you think of this idea?

@artemave
Copy link
Member

artemave commented Feb 6, 2017

What is ViewModel again? :)

@refractalize
Copy link
Member

refractalize commented Feb 22, 2017

What about this: babel-plugin-transform-jsx-hyperdom-binding

In

<input type="text" binding="item[n].method().name"/>

Out

hyperdom.jsx("input", { type: "text", binding: [item[n].method(), "name"] });

@joshski
Copy link
Member Author

joshski commented Feb 22, 2017

I don't use jsx 😜

@joshski
Copy link
Member Author

joshski commented Feb 22, 2017

...or babel 😂

@joshski
Copy link
Member Author

joshski commented Dec 4, 2018

This is just a weird idea. I take it back.

@joshski joshski closed this Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants