Closed bedeoverend closed 7 years ago
Currently get / find / observer methods are sometimes returning references to the internal state, which means changes to these objects will affect Simpla's internal state e.g.
Simpla.get('/image') .then(item => { item.data.alt = 'Some image' }) .then(() => Simpla.get('/image')) .then(item => { // item.data.alt === 'Some Image' });
This PR patches this by ensuring all data returned is a deep clone of the state's data.
Currently get / find / observer methods are sometimes returning references to the internal state, which means changes to these objects will affect Simpla's internal state e.g.
This PR patches this by ensuring all data returned is a deep clone of the state's data.