freifunkmanager/webroot/js/store.js

26 lines
555 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){
2017-05-12 21:32:10 +02:00
var node;
2017-05-08 19:13:29 +02:00
if (store.toupdate[nodeid]) {
2017-05-12 21:32:10 +02:00
node = store.toupdate[nodeid];
} else{
node = store.list[nodeid];
2017-05-08 19:13:29 +02:00
}
2017-05-12 21:32:10 +02:00
node._wireless = store.list[nodeid].wireless;
return node;
2017-05-08 19:13:29 +02:00
});
};
})();