TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Rivets.js - Binding data to views

69 点作者 ansman将近 13 年前

14 条评论

joshontheweb将近 13 年前
I've never been able to get behind defining data relationships in the DOM. I do like the idea of not having to re-render the entire view or explicitly update individual elements on data change events, but i wish there was a better way. Perhaps a view could contain a hash associating data change events with element selectors. Then the view knows which element to update. That way the html clean and ignorant of the underpinnings of the app.
评论 #4212412 未加载
评论 #4212366 未加载
lylejohnson将近 13 年前
Why would I choose Rivets over competing options, such as Knockout?
评论 #4211925 未加载
jashkenas将近 13 年前
Take a peek at the implementation if you haven't already -- it's easy to browse through in a minute or two:<p><a href="https://github.com/mikeric/rivets/blob/master/src/rivets.coffee" rel="nofollow">https://github.com/mikeric/rivets/blob/master/src/rivets.cof...</a><p>... although one thing to note is that it looks like it doesn't currently support IE (&#60; 9).
nateabele将近 13 年前
How is this different from/better than Angular?
pantsbird将近 13 年前
Every time we move away from this ugly logic embedded in the view idea some Rube Goldberg fan (probably with a java struts or other such messy room coding) stacks this stuff back into the world. The fact of the matter is program problems are never difficult enough to merit this kind of abstraction and if in some future where this is necessary it certainly won't be this version or in this syntax.<p>To summarize; Not only do I think this is excessive beyond MVC, but it is also jumping the gun by a decade minimum. I don't need smarty templates, I don't need overloaded HTML attributes and I don't need this. Good day to you.
评论 #4214181 未加载
jarek-foksa将近 13 年前
It would be great if we could just have Object.watch('property', callback) or similar method defined in ES.next.<p>I don't want to wrap my models with ugly frameworks, all I need is a way to fire a callback when my model changes.<p>There is a lot of talk on various MVC frameworks, but lets not forget that manual syncing of views and models has some advantages, e.g. you can improve performance by combining many subsequent DOM operations or by temporarily detaching the parent from DOM tree.
nestlequ1k将近 13 年前
Looks like a pretty nice little alternative to Handlebars/Ember.js for really simple data bindings. I could see myself using this quite often.
netghost将近 13 年前
Neat idea, I like that it's agnostic about the model layer. I have to admit that I'm fiddling around with a very similar library (still a work in progress):<p><a href="https://adamsanderson.github.com/ivy/" rel="nofollow">https://adamsanderson.github.com/ivy/</a><p>Lots of people are looking for better ways to deal with data in their views :)
zimbatm将近 13 年前
After a quick glance it seems that it doesn't support iterations. How would you use it with a list of users ?
评论 #4212135 未加载
1qaz2wsx3edc将近 13 年前
This is most similar to AngularJS. `data-hide` &#60;=&#62; `ng-hide`
swah将近 13 年前
How do you work when you have two or more of those depending on each other?<p>Also, when a data value changes do you re-render the whole thing, of just the affected node?
评论 #4212154 未加载
bdfh42将近 13 年前
lots of knowledgeable comments being made here already so clearly this is an interesting area but - what is the use case for this? I don't understand why I might need it.
评论 #4212068 未加载
arunoda将近 13 年前
Great idea. I like it. I'm looking at this as a template engine? Or am I missing something?
评论 #4214176 未加载
arunoda将近 13 年前
Can you please describe what is the use of the adapter? How can it be useful?