-
Notifications
You must be signed in to change notification settings - Fork 3
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
Array merging is failing for simple types #8
Comments
is it appending? as I am sure there is a boolean you can pass in that tells it to replace or append. |
Turns out I was thinking of the merge constructor:
Which has the boolean to replace or append on merge, so wont be applicable here. |
On a side note given a few people use this lib now it may be worth adding some unit tests to it so at least there are some scenarios to test for all these things, if I get a moment in the week I will try to add some. |
@grofit some automated tests would be good. I get a little lost as soon as people start getting complex build processes, but happy to try and add some simple Jasmine tests etc at some point. I'm basically writing a couple of small tests in a JSFiddle while I'm trying to fix. |
Yeah I didnt want to require nodejs to test it all, and I just never bothered adding jasmine. Have done so now so will add more tests as I go, feel free to fill in the gaps. |
@grofit almost got a fix for this. I'll add some tests when I create a fork. Quick question - you ever had any issues with observable arrays not updating subscribers? I'm currently using the following:
What I'm finding is that I jump to the |
Not that I can remember, what version of KO are you using? |
@grofit 3.3 debug version from cdnjs.com |
@grofit nevermind, had an extra |
@grofit love the speed at which I submit a pull request and it gets merged in :) Thanks! |
❤️ Github |
Not 100% sure why yet but I've just discovered that the array merging isn't working properly for simple objects (e.g. an array of numbers).
Essentially given the following, the resultant
viewModel.values()[0]
will still equal 0.I'm looking into this at the moment, if I find a resolution I'll submit a pull request.
The text was updated successfully, but these errors were encountered: