text: export var location = {
    state: {
      pathname: window.location.pathname,
      previous: window.location.pathname
    },
    actions: {
      go: function(pathname) {
        history.pushState(Object.assign(history.state || {}), "", pathname);
        dispatchEvent(new CustomEvent("pushstate", { detail: pathname }));
      },
      set: function(data) {
        return data;
      }
    },
    subscribe: function(actions) {
      function handleLocationChange(e) {
        actions.set({
          pathname: window.location.pathname,
          previous: e.detail
            ? (window.location.previous = e.detail)
            : window.location.previous
        });
      }
  
      addEventListener("pushstate", handleLocationChange);
      addEventListener("popstate", handleLocationChange);
  
      return function() {
        removeEventListener("pushstate", handleLocationChange);
        removeEventListener("popstate", handleLocationChange);
      };
    }
  };
  