Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ node_modules/
npm-debug.log
.coverrun
coverage/coverage.html
/universe.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably don't want to commit these

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @tannerlinsley,
reverted .gitignore to original.
Updated crossfilter to latest release (1.4.6)

/universe.min.js

npm-debug.log*
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
},
"files": ["src", "universe.*"],
"dependencies": {
"crossfilter2": "1.4.1",
"reductio": "^0.6.2"
"crossfilter2": "1.4.3",
"reductio": "^0.6.3"
},
"devDependencies": {
"ava": "^0.15.2",
Expand Down
26 changes: 21 additions & 5 deletions src/crossfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,37 @@ module.exports = function (service) {
return promise.then(data)
}, Promise.resolve(true))
})

.then(function() {
return Promise.all(_.map(service.filterListeners, function (listener) {
return listener()
}))
})

.then(function () {
return service
})
}

function remove() {
function remove(predicate) {
return new Promise(function (resolve, reject) {
try {
resolve(service.cf.remove())
resolve(service.cf.remove(predicate))
} catch (err) {
reject(err)
}
})
.then(function () {
return service
})

.then(function() {
return Promise.all(_.map(service.filterListeners, function (listener) {
return listener()
}))
})

.then(function () {
return service
})
}
}


Loading