Salte Filter
Registers filter components allowing for a single input and output!
Install
You can install this package either with npm
or with bower
.
npm
$ npm install salte-filter
Then add a <script>
to your index.html:
Or require('salte-filter')
from your code.
bower
$ bower install salte-io/salte-filter
Then add a <script>
to your index.html:
Example
Usage
Documentation
salteFilter
must be required into your component in order to be used
(add/remove)Filter
filter
: A filter to be called anytime the filter function is called
const component = require: parent: '^salteFilter' { const view = this; view { // ... returns the item if the function returns truthy }; view { // This will add the filter viewparent; // This will remove the filter viewparent; }; }
(add/remove)FilterListener
listener
: A listener to be called anytime the filter function is called
const component = require: parent: '^salteFilter' { const view = this; view { // ... }; view { // This will add the listener viewparent; // This will remove the listener viewparent; }; }
filter
Runs all of the filters, useful for triggering a filter when an input value is changed