Store the last tab in a cookie so the server can use it for embedding state
This commit is contained in:
parent
4cad5a0b33
commit
8684e2dea2
8 changed files with 95 additions and 49 deletions
|
@ -1,10 +1,11 @@
|
|||
import Cookie from 'js-cookie';
|
||||
import debounce from 'lodash/debounce';
|
||||
import observe from '../util/observe';
|
||||
import { getSelectedTab } from '../reducers/tab';
|
||||
|
||||
const saveTab = debounce(tab => {
|
||||
localStorage.tab = JSON.stringify(tab);
|
||||
}, 3000);
|
||||
const saveTab = debounce(tab =>
|
||||
Cookie.set('tab', tab.toString(), { expires: 30 })
|
||||
, 3000);
|
||||
|
||||
export default function storage({ store }) {
|
||||
observe(store, getSelectedTab, tab => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue