Partial sorting
This commit is contained in:
@ -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 ){
|
||||
|
||||
@ -116,10 +116,10 @@ const localstorageMiddleware = (function(){
|
||||
localStorage.setItem('spotify', JSON.stringify(spotify));
|
||||
break;
|
||||
|
||||
case 'SET_VIEW':
|
||||
case 'UI_SET':
|
||||
var ui = JSON.parse( localStorage.getItem('ui') );
|
||||
if( !ui ) ui = {};
|
||||
Object.assign( ui, action.view );
|
||||
Object.assign( ui, action.data );
|
||||
localStorage.setItem('ui', JSON.stringify(ui));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -72,10 +72,10 @@ export function dragEnd(){
|
||||
return { type: 'DRAG_END' }
|
||||
}
|
||||
|
||||
export function setView( view ){
|
||||
export function set( data ){
|
||||
return {
|
||||
type: 'SET_VIEW',
|
||||
view: view
|
||||
type: 'UI_SET',
|
||||
data: data
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,13 +10,8 @@ export default function reducer(ui = {}, action){
|
||||
case 'DEBUG':
|
||||
return Object.assign({}, ui, { debug_response: action.response })
|
||||
|
||||
|
||||
/**
|
||||
* UI views and view modes
|
||||
**/
|
||||
|
||||
case 'SET_VIEW':
|
||||
return Object.assign({}, ui, action.view)
|
||||
case 'UI_SET':
|
||||
return Object.assign({}, ui, action.data)
|
||||
|
||||
case 'TOGGLE_SIDEBAR':
|
||||
var new_state = !ui.sidebar_open
|
||||
|
||||
Reference in New Issue
Block a user