View toggling; Enhanced List component

This commit is contained in:
James Barnsley
2016-11-21 16:26:47 +13:00
parent 8d1436996c
commit 6588790476
10 changed files with 197 additions and 42 deletions

View File

@ -12,7 +12,7 @@ const localstorageMiddleware = (function(){
// append our state to a global variable. This gives us access to debug the store at any point
window._store = store
console.log(action)
//console.log(action)
switch( action.type ){
@ -114,6 +114,13 @@ const localstorageMiddleware = (function(){
);
localStorage.setItem('spotify', JSON.stringify(spotify));
break;
case 'SET_VIEW':
var ui = JSON.parse( localStorage.getItem('ui') );
if( !ui ) ui = {};
Object.assign( ui, action.view );
localStorage.setItem('ui', JSON.stringify(ui));
break;
}
}