Skip to content
/ pdsp Public

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

License

Notifications You must be signed in to change notification settings

fibo/pdsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published