Skip to content
Snippets Groups Projects
Commit 2de79abf authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[ivette] simplify internal states

parent 3d6c6b3d
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,8 @@ export function setProject(project) ...@@ -72,7 +72,8 @@ export function setProject(project)
export function clearProject(project) export function clearProject(project)
{ {
const theProject = project || currentProject ; const theProject = project || currentProject ;
_.unset( globalStates , ['states',theProject] ); if (theProject)
_.unset( globalStates , [theProject] );
Dome.emit(PROJECT); Dome.emit(PROJECT);
} }
...@@ -101,7 +102,7 @@ export function useState(id,project) ...@@ -101,7 +102,7 @@ export function useState(id,project)
Dome.useUpdate(PROJECT,theEvent); Dome.useUpdate(PROJECT,theEvent);
const theProject = project || currentProject ; const theProject = project || currentProject ;
if (!theProject) return NONE; if (!theProject) return NONE;
const thePath = ['states',theProject,id] ; const thePath = [theProject,id] ;
const theValue = _.get( globalStates, thePath ); const theValue = _.get( globalStates, thePath );
const setValue = (v) => { const setValue = (v) => {
Dome.emit(theEvent,v); Dome.emit(theEvent,v);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment