named exports, for tree-shakeability when we add new stuff

This commit is contained in:
Rich Harris
2017-12-17 15:01:26 -05:00
parent 62abdb2a87
commit 8b50ff34b8

View File

@@ -2,7 +2,7 @@ const detach = node => {
node.parentNode.removeChild(node); node.parentNode.removeChild(node);
}; };
let component; export let component;
let target; let target;
let routes; let routes;
@@ -158,8 +158,7 @@ function findAnchor(node) {
let inited; let inited;
const app = { export function init(_target, _routes) {
init(_target, _routes) {
target = _target; target = _target;
routes = _routes; routes = _routes;
@@ -178,8 +177,7 @@ const app = {
history.replaceState({ id: uid }, '', window.location.href); history.replaceState({ id: uid }, '', window.location.href);
navigate(new URL(window.location), uid); navigate(new URL(window.location), uid);
} }
};
function which(event) { function which(event) {
event = event || window.event; event = event || window.event;
@@ -192,5 +190,3 @@ function scroll_state() {
y: window.scrollY y: window.scrollY
}; };
} }
export default app;