knockout-projections icon indicating copy to clipboard operation
knockout-projections copied to clipboard

Defer evaluation on projected arrays

Open tedsteen opened this issue 11 years ago • 5 comments

Whenever you create a projection it is evaluated immediately. Why not defer it?

After we moved over to knockout-projections the initial page load time was higher because all our filtered and mapped arrays where deferred until first usage in our implementation.

tedsteen avatar Jan 03 '14 10:01 tedsteen

It would just be a bit more complex to implement. If it becomes a common requirement then I'd definitely consider implementing it.

SteveSanderson avatar Feb 18 '14 15:02 SteveSanderson

I was wishing for the same thing when implementing a tree structure. While there are many way to achieve lazy loading, I think having this feature in the library makes the code the cleanest.

tp avatar Aug 13 '14 21:08 tp

:+1: This would be very useful. When performance is a key concern (as is the case when utilizing knockout-projections), it's often necessary to defer evaluation of calculated properties until they are needed.

CraigCav avatar Nov 14 '14 14:11 CraigCav

:+1: This would be very useful addition.

navnitmehta avatar Jul 02 '15 17:07 navnitmehta

+1

It doesn't seem like you'd want the mapping functions to be called until the observable is used. I think this library could be improved by leveraging some of the features added in the last couple releases of knockout. (defer updates, pure computeds, etc)

jrsearles avatar Feb 26 '16 17:02 jrsearles