Previously saved editor state can be easily loaded back into the editor allowing for implementing various functionality, like backing up user work, letting user pick from a set of predefined designs, autosave and so on.
Loading editor state
var state; //previously saved editor state
var pixie = new Pixie({
onLoad: function() {
pixie.loadState(state).then(function() {
//state has been loaded
});
}
});
Getting editor state from the server
Note that this is just an example for getting editor state from the server using pixie's http client. You can also get it from browser's local storage, your own app, or any other way you might need.
var pixie = new Pixie({
onLoad: function() {
pixie.loadStateFromUrl('https://your-site.com/state.json').then(function() {
//state has been loaded
});
}
});