Remove functions finally not needed in Table module
This commit is contained in:
parent
26020a5539
commit
4ea3b57e1d
1 changed files with 0 additions and 20 deletions
20
js/Table.js
20
js/Table.js
|
@ -4,7 +4,6 @@ import {compare, of, proj} from UnitJS.Fun;
|
|||
function Table(itemMaker, sortCriterion) {
|
||||
var items = {};
|
||||
return {
|
||||
dump: dump,
|
||||
get: get,
|
||||
getAll: getAll,
|
||||
insert: insert,
|
||||
|
@ -12,10 +11,6 @@ function Table(itemMaker, sortCriterion) {
|
|||
remove: remove
|
||||
};
|
||||
|
||||
function dump() {
|
||||
return items;
|
||||
}
|
||||
|
||||
function get(key) {
|
||||
return items[key];
|
||||
}
|
||||
|
@ -37,24 +32,9 @@ function Table(itemMaker, sortCriterion) {
|
|||
}
|
||||
}
|
||||
|
||||
function update(mapper) {
|
||||
for(var key in items) {
|
||||
var newValue = mapper(items[key]);
|
||||
if(newValue != undefined) {
|
||||
insert(key, newValue);
|
||||
} else {
|
||||
remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function remove(key) {
|
||||
delete items[key];
|
||||
}
|
||||
|
||||
function restore(dumped) {
|
||||
items = dumped;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue