CodeYellowBV / mobx-spine

MobX with support for models, relations and an external API.
31 stars 14 forks source link

Parse empty list bug #108

Closed daanvdk closed 3 years ago

daanvdk commented 3 years ago

When an empty list is sent in the data in Model.parse it used to be ignored. This can cause bugs because old data remains around. I changed the check for when to parse a list from 'a list where the first element is a plain object' to 'a list where every element is a plain object'. This actually makes the check more correct for lists with multiple base cases and the base case for every makes sure it also works for the empty list.