npm.io
0.8.11 • Published 3 years ago

@pluginjs/events

Licence
GPL-3.0
Version
0.8.11
Deps
3
Size
47 kB
Vulns
0
Weekly
0
Stars
17

Events

npm package

events is a utility JavaScript library for dom event interface.

Introduction

Installation

Yarn
yarn add @pluginjs/events
NPM
npm i @pluginjs/events

Getting Started

CDN:

Development:

<script src="https://unpkg.com/@pluginjs/events/dist/events.js"></script>

Production:

<script src="https://unpkg.com/@pluginjs/events/dist/events.min.js"></script>

API

trigger

Parameters

| Name | Type | Description | |||-| | event | String or CustomEvent | evnetName or customEvent | | [ extraParams ] | String or PlainObject | one or more or null | | element | HTMLElement | |

bindEvent

Parameters

| Name | Type | Description | |||-| | events | String | One or more space-separated event types and optional namespaces | | [ selector ] | String | | | callback | Function | | | element | HTMLElement | |

Returns

| Name | Type | Description | |||-| | element | HTMLElement | |

removeEvent

Parameters

| Name | Type | Description | |||-| | events | String | One or more space-separated event types and optional namespaces | | [ selector ] | String | | | callback | Function | | | element | HTMLElement | |

Returns

| Name | Type | Description | |||-| | element | HTMLElement | |

bindEventOnce

Parameters

| Name | Type | Description | |||-| | events | String | One or more space-separated event types and optional namespaces | | [ selector ] | String | | | callback | Function | | | element | HTMLElement | |

Returns

| Name | Type | Description | |||-| | element | HTMLElement | |

getEventEmitter

Parameters

| Name | Type | Description | |||-| | element | HTMLElement | |

Returns

| Name | Type | Description | |||-| | eventEmitter | EventEmitter | |

Browser support

Tested on all major browsers.

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

License

@pluginjs/events is Licensed under the GPL-v3 license.

If you want to use @pluginjs/events project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

Copyright (C) 2022 Creation Studio Limited.