improve: filter as a plugin (#4255)

This commit is contained in:
David Vujic
2018-02-28 00:44:30 +01:00
committed by kyle
parent 6f7a4c3097
commit e6722d87aa
6 changed files with 62 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
import opsFilter from "./opsFilter"
export default function() {
return {
fn: {
opsFilter
}
}
}

View File

@@ -0,0 +1,3 @@
export default function(taggedOps, phrase) {
return taggedOps.filter((tagObj, tag) => tag.indexOf(phrase) !== -1)
}