Giter Site home page Giter Site logo

mediamonks / seng-disposable-event-listener Goto Github PK

View Code? Open in Web Editor NEW

This project forked from riccoarntz/seng-disposable-event-listener

0.0 2.0 0.0 391 KB

The DisposableEventListener is a wrapper around the native addEventListener method, which makes it easier to remove the handlers. By destructing this object, the listener is removed

License: MIT License

JavaScript 25.45% HTML 8.40% TypeScript 57.21% CSS 8.94%

seng-disposable-event-listener's Introduction

seng-disposable-event-listener

The DisposableEventListener is a wrapper around the native addEventListener method, which makes it easier to remove the handlers. By destructing this object, the listener is removed

Installation

yarn / npm

yarn add seng-disposable-event-listener
npm i -S seng-disposable-event-listener

Usage

Constructing.

  const windowResizeListener:DisposableEventListener = new DisposableEventListener(
    window, 
    resize',
    this.handleResize.bind(this)
  );

Disposing

  windowResizeListener.dispose();

Building

In order to build seng-disposable-event-listener, ensure that you have Git and [Node.js] (http://nodejs .org/) installed.

Clone a copy of the repo:

git clone https://github.com/riccomediamonks/seng-disposable-event-listener.git

Change to the seng-disposable-event-listener directory:

cd seng-disposable-event-listener

Install dev dependencies:

yarn

Use one of the following main scripts:

yarn build           # build this project
yarn dev             # run dev-watch mode, serving example/index.html in the browser
yarn generate        # generate all artifacts (compiles ts, webpack, docs and coverage)
yarn test:unit       # run the unit tests
yarn validate        # runs validation scripts, including test, lint and coverage check
yarn lint            # run tslint on this project
yarn doc             # generate typedoc documentation

When installing this module, it adds a pre-push hook, that runs the validate script before committing, so you can be sure that everything checks out.

seng-disposable-event-listener's People

Contributors

riccoarntz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.