New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No sort() method? #81
Comments
Interesting, this never crosses my mind. An issue I can foresee is you'd expect the result of the sort has to be a new cortex object. Currently, If you want to sort and mutate the array then you can sort the array value first and then set it to the sorted version. I could be wrong but I don't see a use case where you need a sorted cortex wrapper but not mutate the original array wrapper |
That's what I thought, too -- just set the property to a new array. That wasn't working for me, though. I think it's because my array is nested. Can you confirm that this:
Will not fire an update event? I just want to make sure I'm not crazy. It sounds like Cortex prefers that everything is at the root level. |
You change the content of the cortex object so of course it will fire an update event. Because otherwise how would component update when your data changed? If you don't want to fire an update then may be it shouldn't be part of your cortex object. The whole point of cortex is to allow you to pass nested data to nested children as props and be able to trigger update from any child component |
OK, yeah, I actually do want it to fire an update event. The documentation is kind of ambiguous, though. You show an example for the Can you just confirm that all three of those |
anywhere you call |
Is there a reason why
sort()
was left out of theArrayWrapper
? If so, how do you recommend dealing with sort?The text was updated successfully, but these errors were encountered: