+export const page = writable({count: 0});
+
+export function refresh_page() {
+ let pagename = window.location.pathname.replace('.html', '').replace(/^.*\//, '');
+
+ if (['search', 'reverse', 'details', 'deletable', 'polygons'].indexOf(pagename) == -1) {
+ pagename = 'search';
+ }
+
+ // Add a counter here to make sure the store change is triggered
+ // everytime we refresh, not just when the page changes.
+ page.update(function(v) { return {tab: pagename, count: v.count + 1}});
+}