-
Notifications
You must be signed in to change notification settings - Fork 18
Serialization
linusha edited this page May 8, 2021
·
2 revisions
- one needs to define
propertiesto have them saved
- saving creates a snapshot
- the serializer dissolves circular dependencies
- when serializing was successful, lively tries to deserialize the snapshot onces
- only if this works saving was successful
- Be aware of adding objects to the opened world!!
- some objects can not be saved by default
- for example weak maps
- you can use methods like
__after_deserialize__and similar as hooks - if you want to save something circular like a morph structure in the snapshot customized use
addFn('propertyName' , propertyValue)this will have a look on the dependencies and will dissolve the circular dependencies if necessary - just adding
snapshot.prop.propname = propValuewill work but not check whether there are circular dependencies