component / reactive

Tiny reactive template engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a little confused from the docs

ianstormtaylor opened this issue · comments

  1. Am I supposed to be able to do this: <h1>{name}</h1> and have that call a function on my model/view, without having to use parens: name()?
  2. Am I supposed to be able to do this: <h1>{name()}</h1> and have that auto subscribe to changes for me?
  3. Am I supposed to be able to to this: <h1>{name()}</h1> and have that reference View.prototype.name instead of only Model.prototype.name?
  4. Am I supposed to be able to do this: <div class="{enabled() ? 'enabled' : 'disabled'}"></div> and have that automatically be smart and bind a subscription to change enabled?

None of these things seem to be working for me right now.

I should mention that I'm working with component/model and a view, not just plain objects with emitters. I can't seem to get some of this magic working. I really wish it did cuz reactive seems like potentially the coolest thing ever made.

Sorry if I'm doing something incredibly stupid.

Okay had a chance to read through the source now, and a couple of these can be answered.

  1. Solved by #62 .
  2. Due to this problem: component/props#2
  3. This ones complicated...
  4. Same problem as 2.

Gonna open a new issue with 3 and 4 which have similar problems.