https://github.com/glebmachine/event-filter
Filter handling by specified function
https://github.com/glebmachine/event-filter
Last synced: about 1 month ago
JSON representation
Filter handling by specified function
- Host: GitHub
- URL: https://github.com/glebmachine/event-filter
- Owner: glebmachine
- Created: 2015-09-22T17:51:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-01T15:06:31.000Z (over 9 years ago)
- Last Synced: 2023-03-22T12:35:29.408Z (about 2 years ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# event-filter.js
Filter handling by specified function# Example
```javascript
// create filter
var handlerFn = createFilter(renderFn, filterFn);// perform Some repaints or/and calculations
function renderFn(value) {
// value - results of filterFn
}// if returned value not equal previous value, renderFn will called
function filterFn() {
return document.body.clientWidth > 1024;
}// assign listener to event
window.onresize = handlerFn;
```