ember-infinity icon indicating copy to clipboard operation
ember-infinity copied to clipboard

Move to Immutable Arrays

Open hhff opened this issue 10 years ago • 2 comments

A concern I have is that Ember Infinity heavily relies on "pushing objects" into arrays. I don't think this is a great approach - as it relies on Ember's pushObjects API staying consistent - the _internalModel stuff is confusing for folks.

Instead I think we should be creating new arrays based on the existing & new data.

@davidgoli also raised some concern about using the store's query object in ember infinity. I agree. David - can you share some of your thoughts here?

hhff avatar Apr 11 '16 17:04 hhff

After watching this EmberConf Talk https://www.youtube.com/watch?v=r2Cq1mUlRk4, I think a switch to Immutable Arrays and replacing the model could be very interesting. It would also solve an issue I am currently having with updating the meta property of the model – which seems impossible even if I explicitly set it in the afterInfinityModel hook. (Explanation: I am trying to access currentPage information in the template.)

mphasize avatar Apr 27 '16 13:04 mphasize

Thanks @mphasize - I saw that talk live and it BLEW my MIND

However, the meta issue you're having isn't related to this. Please open a separate issue and I'll see if I can help!

hhff avatar Apr 27 '16 15:04 hhff