canjs / can-map-backup

Backup and restore a Maps state
https://v3.canjs.com/doc/can-map-backup.html
MIT License
2 stars 1 forks source link

can.Map.backup restore removes properties ~8 #3

Open justinbmeyer opened 8 years ago

justinbmeyer commented 8 years ago

From https://github.com/canjs/canjs/issues/2126

The docs state: restore will not remove properties that were added since the last backup, but it will re-add properties that have been removed..

This line of code will remove properties however: https://github.com/canjs/canjs/blob/master/map/backup/backup.js#L33

According to this discussion: https://github.com/canjs/canjs/pull/607, it seems like the docs may be out of date, though we should have this as optional. restore() should be able to both remove/not remove properties just as attr() does.

http://canjs.com/docs/can.Map.backup.prototype.restore.html