UNPKG

list.js

Version:

The perfect library for lists. Supports search, sort, filters and flexibility. Built to be invisible and work on existing HTML

17 lines (16 loc) 403 B
module.exports = function (list) { var addAsync = function (values, callback, items) { var valuesToAdd = values.splice(0, 50) items = items || [] items = items.concat(list.add(valuesToAdd)) if (values.length > 0) { setTimeout(function () { addAsync(values, callback, items) }, 1) } else { list.update() callback(items) } } return addAsync }