driver-worker
Advanced tools
Comparing version 0.6.6-5 to 0.6.6-6
@@ -41,2 +41,9 @@ "use strict"; | ||
function createLocation() { | ||
var sendLocationDirective = function sendLocationDirective(data) { | ||
return postMessage({ | ||
type: 'Location', | ||
data: data | ||
}); | ||
}; | ||
return { | ||
@@ -49,8 +56,23 @@ get href() { | ||
document.URL = url; | ||
postMessage({ | ||
type: 'Location', | ||
href: url | ||
sendLocationDirective({ | ||
type: 'assign', | ||
prop: 'href', | ||
val: url | ||
}); | ||
}, | ||
replace: function replace(url) { | ||
document.URL = url; | ||
sendLocationDirective({ | ||
type: 'call', | ||
prop: 'replace', | ||
args: [url] | ||
}); | ||
}, | ||
reload: function reload() { | ||
sendLocationDirective({ | ||
type: 'call', | ||
prop: 'reload' | ||
}); | ||
} | ||
}; | ||
@@ -57,0 +79,0 @@ } |
{ | ||
"name": "driver-worker", | ||
"version": "0.6.6-5", | ||
"version": "0.6.6-6", | ||
"description": "Worker driver for Rax", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
@@ -29,2 +29,3 @@ import { convertUnit, setRem } from 'style-unit'; | ||
function createLocation() { | ||
const sendLocationDirective = (data) => postMessage({ type: 'Location', data }); | ||
return { | ||
@@ -36,4 +37,11 @@ get href() { | ||
document.URL = url; | ||
postMessage({ type: 'Location', href: url }); | ||
sendLocationDirective({ type: 'assign', prop: 'href', val: url }); | ||
}, | ||
replace(url) { | ||
document.URL = url; | ||
sendLocationDirective({ type: 'call', prop: 'replace', args: [url] }); | ||
}, | ||
reload() { | ||
sendLocationDirective({ type: 'call', prop: 'reload' }); | ||
}, | ||
}; | ||
@@ -40,0 +48,0 @@ } |
87819
2766