UNPKG

@gang-js/core

Version:

a state sharing algorithm

21 lines (20 loc) 497 B
/** * Small wrapper for location functions */ export class GangLocationService { get host() { return location.host; } get origin() { return `${location.protocol}//${location.host}`; } get href() { return location.href; } pushState(url) { history.pushState(null, document.title, url); } static get instance() { return GangLocationService._instance || (GangLocationService._instance = new GangLocationService()); } }