If I create a context and add some layout and surfaces, but later want to restart the entire app is there a way to do this?
Is there a method on the Engine?
Basically I am asking if there is something that is the opposite of Engine.createContext ?
If I create a context and add some layout and surfaces, but later want to restart the entire app is there a way to do this?
Is there a method on the Engine?
Basically I am asking if there is something that is the opposite of Engine.createContext ?
You can use a RenderController to add/remove content from the render-tree:
// import dependencies
var Engine = require('famous/core/Engine');
var RenderNode = require('famous/core/RenderNode');
var RenderController = require('famous/views/RenderController');
// create context & render-controller
var context = Engine.createContext();
var renderController = new RenderController();
context.add(renderController);
function restart() {
// create content you want to show
var content = new AppView();
// Show content
var renderNode = new RenderNode(content);
renderController.show(renderNode, {duration: 0});
}
restart();