August 2017
Beginner
374 pages
10h 41m
English
The persistState store enhancer requires a session key as an argument. You can implement any functionality you want here. For the sake of simplicity, we will define a function to get it from the URL query parameters, like this:
http://localhost:8080/?debug=SESSION_KEY
Let's implement a session key provider that reads from URL query params:
function getSessionKey () { const matches = window.location.href.match(/[?&]debug=([^&#]+)\b/)
return (matches && matches.length > 0) ? matches[1] : null}
Read now
Unlock full access