freifunkmanager/webroot/js/store.js

22 lines
452 B
JavaScript
Raw Normal View History

2017-05-08 19:13:29 +02:00
var store = {
list:{},
toupdate:{}
};
(function(){
store.updateReal = function updateReal(node){
store.list[node.node_id] = node;
};
store.update = function update(node){
store.toupdate[node.node_id] = node;
};
store.will = function() {
return Object.keys(store.list).map(function(nodeid){
if (store.toupdate[nodeid]) {
return store.toupdate[nodeid];
}
return store.list[nodeid];
});
};
})();