Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagas/binder
High level common api for event/delegate.
https://github.com/stagas/binder
Last synced: 14 days ago
JSON representation
High level common api for event/delegate.
- Host: GitHub
- URL: https://github.com/stagas/binder
- Owner: stagas
- Created: 2013-03-11T13:04:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-03-11T14:07:47.000Z (over 11 years ago)
- Last Synced: 2024-04-08T15:44:32.175Z (7 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# binder
high level common api for event/delegate
## Install
```sh
$ component-install stagas/binder
```## API
### binder.on(`el`, `event`, `[selector]`, `fn`, `[capture]`)
> _returns_ elBind to `event` for `el` and invoke `fn(e)`.
When a `selector` is given then events are delegated.### binder.off(`el`, `event`, `[selector]`, `fn`, `[capture]`)
> _returns_ elUnbind `event` listener `fn` for `el`.
### binder.once(`el`, `event`, `[selector]`, `fn`, `[capture]`)
> _returns_ elSame as `.on` but will call `.off`
immediately after the first event.## Credits
Used bits from [component/dom](https://github.com/component/dom) (MIT)
## License
MIT