Interface: Restorable

Restorable

Restorable is an object that can be restored from the data a Serializable created.

Methods

(static) restore() → {T|Promise.<T>}

Parameters:
Type Description
object The saved data
Returns:
- A new object, restored with the saved data.
Type
T | Promise.<T>

importFromSaveData(saveData) → (nullable) {Promise}

This method should "merge" the saved data into existing object. Implementing this prevents new object to be created during restore, probably improve performance.
Parameters:
Name Type Description
saveData object The data to be imported to the current object.
Returns:
- A promise that resolves when import finish, undefined means it finished already.
Type
Promise