261325 (1) [Avatar] Offline
#1
I'm having some issues with the multi-select stuff at the end of chapter 7.
these are the changes I needed to make to get this working...

1. It doesn't seem like computedFrom works with arrays - if I change to 'temporaryBook.shelves.length', canSave gets called corrected.
2. The comparison on the arrays is '=='; which is doing reference comparison which isn't what we want; also see 3; change to use _.isEqual
3. Object.assign does a shallow copy, so the shelves of temporaryBook is the same instance as book.shelves so they are always the same. Need to create new array and copy shelves from book to temporaryBook.

Thanks,
Eric
Sean Hunter (29) [Avatar] Offline
#2
Thanks for the feedback it's much appreciated! smilie

Will take a look at the chapter 7 sample code and get back to you.