@rpcbase/client 0.66.0 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/hashState.js +4 -4
  2. package/package.json +1 -1
package/hashState.js CHANGED
@@ -30,17 +30,17 @@ const parse_hash_str = (hash_str = window.location.hash) => {
30
30
  // On first load, retrieve hashState from URL
31
31
  const __initial_state = _omitBy(parse_hash_str(), _isNil)
32
32
 
33
- export const encode_payload = (payload) =>
33
+ export const encodeHashState = (payload) =>
34
34
  LZString.compressToEncodedURIComponent(JSON.stringify(payload))
35
35
 
36
36
  // add payload to window hash
37
37
  const apply_hash_state = (payload) => {
38
- const str = encode_payload(payload)
38
+ const str = encodeHashState(payload)
39
39
 
40
40
  if (str === EMPTY_STATE_TOKEN) {
41
41
  history.replaceState(null, null, window.location.pathname)
42
42
  } else {
43
- history.replaceState(null, null, `${window.location.pathname}#${encode_payload(payload)}`)
43
+ history.replaceState(null, null, `${window.location.pathname}#${encodeHashState(payload)}`)
44
44
  }
45
45
  }
46
46
 
@@ -124,7 +124,7 @@ export const HashStateProvider = ({children}) => {
124
124
  _isNil,
125
125
  )
126
126
 
127
- return encode_payload(newState)
127
+ return encodeHashState(newState)
128
128
  }, [])
129
129
 
130
130
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.66.0",
3
+ "version": "0.67.0",
4
4
  "scripts": {
5
5
  "test": "jest"
6
6
  },