How to use the cx/ui.History.connect function in cx

To help you get started, we’ve selected a few cx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codaxy / dashboards / app / index.js View on Github external
module.hot.accept();

	// remember data on dispose
	module.hot.dispose(function(data) {
		data.state = store.getData();
		if (stop) stop();
	});

	//apply data on hot replace
	if (module.hot.data) store.load(module.hot.data.state);
}

//routing

Url.setBaseFromScript("app*.js");
History.connect(store, "url");

//debug

Widget.resetCounter();
Timing.enable("app-loop");
Debug.enable("app-data");

//app loop
import Routes from "./routes";

let stop = startAppLoop(document.getElementById("app"), store, Routes);
github codaxy / tdo / app / index.js View on Github external
import { startHotAppLoop, History } from "cx/ui";
import { Debug } from "cx/util";
import Routes from "./routes";
import "./index.scss";

import { Store } from "cx/data";
const store = new Store();

History.connect(
  store,
  "url"
);

Debug.enable("app-data");

startHotAppLoop(module, document.getElementById("app"), store, Routes);