Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : When is it appropriate to use a method vs a compute within a can.Component scope?

$
0
0
Well, so in the example posted on can doc's, they're using next as a plain function and not a compute when the result is very much so both a state, and computable. I don't see any reason why it wouldn't be declared as a compute.

Within the template, if the function is already a compute, will it skip the overhead of converting it into a compute? In that sense, I could see it being more efficient to represent all derived states as computes. 


Viewing all articles
Browse latest Browse all 3491

Trending Articles