1.1.0 • Published 11 months ago

just-on v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

just-on

test npm cdn version


Just the event module of jQuery

why?

If you are passionate about developing JavaScript plugins and want to get rid of jQuery, but also enjoy its use of event binding, then this library is very useful for you, which is also its main use case

install

$ npm i -D just-on

usage

import { on, off, one } from 'just-on'

// bind an event once
one('#btn', 'mouseenter', function () {
  console.log('Mouse movement only takes effect once')
})

//bind click event
on('#btn', 'click', function () {
  console.log('binded!')
})

//remove click event
off('#btn', 'click')

We just placed the selector parameter in the first position of the method here

For details, please refer to : onoffone

1.1.0

11 months ago

1.0.0

11 months ago

0.0.0

1 year ago