pdsp

0.1.0 • Public • Published

pdsp

saves bytes in your build with a shortcut to event preventDefault and stopPropagation

pdsp === pD sP === preventDefault stopPropagation

Usage

Suppose you have your onClick handler and you need to call preventDefault and stopPropagation methods, like this

class MyComponent extends OtherComponent {
  onClick (event) {
    event.preventDefault()
    event.stopPropagation()
 
    // Follows code to handle event.
  }
}

Using pdsp it will look like

const pdsp = require('pdsp')
 
class MyComponent extends OtherComponent {
  onClick (event) {
    pdsp(event)
 
    // Follows code to handle event.
  }
}

License

MIT

Package Sidebar

Install

npm i pdsp

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

2.6 kB

Total Files

4

Last publish

Collaborators

  • fibo