diff options
author | Matthew Shao <me@matshao.com> | 2017-04-30 22:40:58 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2017-04-30 22:40:58 +0800 |
commit | 365677006cc9f749a59ce5b5cf9b13d50dca8c0f (patch) | |
tree | 7ec58566b4eb219661283b9f2efaf17b7fdcc9ba /web/src/js/urlState.js | |
parent | a7feced5deb2e9b8a874260e59c8badc0153c2be (diff) | |
download | mitmproxy-365677006cc9f749a59ce5b5cf9b13d50dca8c0f.tar.gz mitmproxy-365677006cc9f749a59ce5b5cf9b13d50dca8c0f.tar.bz2 mitmproxy-365677006cc9f749a59ce5b5cf9b13d50dca8c0f.zip |
[web] Export updateUrlFromStore and updateStoreFromUrl
Diffstat (limited to 'web/src/js/urlState.js')
-rw-r--r-- | web/src/js/urlState.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/src/js/urlState.js b/web/src/js/urlState.js index fcad3de3..7802bdb8 100644 --- a/web/src/js/urlState.js +++ b/web/src/js/urlState.js @@ -15,7 +15,7 @@ const Query = { SHOW_EVENTLOG: "e" }; -function updateStoreFromUrl(store) { +export function updateStoreFromUrl(store) { const [path, query] = window.location.hash.substr(1).split("?", 2) const path_components = path.substr(1).split("/") @@ -50,7 +50,7 @@ function updateStoreFromUrl(store) { } } -function updateUrlFromStore(store) { +export function updateUrlFromStore(store) { const state = store.getState() let query = { [Query.SEARCH]: state.flows.filter, @@ -78,6 +78,6 @@ function updateUrlFromStore(store) { } export default function initialize(store) { - store.subscribe(() => updateUrlFromStore(store)) updateStoreFromUrl(store) + store.subscribe(() => updateUrlFromStore(store)) } |