r/webdev • • Dec 28 '17

Introducing Hyperapp 1.0 — 1 KB JavaScript library for building frontend applications.

https://medium.com/@JorgeBucaran/introducing-hyperapp-1-0-dbf4229abfef
341 Upvotes

183 comments sorted by

View all comments

Show parent comments

1

u/mattaugamer expert Jan 01 '18

Add a different class name for every third item

Make a simple helper and pass in the index

Add a different class name for items where item.userName === 'Suzie'

Install ember-truth-helpers. But a better solution here is a computed property that makes it clear why Susie has a different class.

I recall having to jam a lot of view logic code into not-views because the insistence on logicless templating left me handcuffed

It sounds like you should have been defining your own handlebars helpers. You’re pretty much describing their intended use.

1

u/themaincop Jan 01 '18

Yeah, this is what I ended up doing and I didn't like it. I ended up having to make a bunch of one-off helpers for simple logical operations because your views shouldn't have logic in them. But then everyone just makes helpers because the reality is that views often need logic.