Closed getnashty closed 9 years ago
We can request the list of ids from the BC backend and calculate the average of those in JS.
why calculate in JS, rather than just sending back the calculated avg?
Couple Reasons
Will it affect speed for the calculation to be done on the user's machine, rather than stored on BC and incrementally updated?
No calculating an average is nothing. Unless you have millions of objects then maybe we need OLOO
For pages like this: http://staging.croovies.com/people/27
We'll need an "avg" shape item... IE, a list of ID's returns an average shape of the ratings of those IDs.
This element cannot be manipulated by the user.
I'm thinking about two different ways of managing this - either the publisher has hooks into BC (so on croovies backend, we can created new "avg" objects by supply a bunch of ID, and BC returns an "avgItemID"... Then we use that id in the BCJS element...
Or, the element itself accepts an array of ID, and returns the avg on the fly... While this seems easier for the publishers, it seems more calculation intensive/expensive for BC...
Thoughts?