New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

minsky-blmanager

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minsky-blmanager

Binded listeners manager

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

BLManager

Event binding management for your projects Bound listeners are hard to unbind when developement hasn’t kept them aside. This class helps to manage it all without having to rewrite the logic every time.

Class type: Manager

Dependencies

  • Core - 1.1.0

Getting started

const mgr =  new  BLManager({
	scope:  this
});

// bind listeners tot he current scope
$domElement.addEventListener('click', mgr.add('domClick', domClick));
$domElement.removeEventListener('click', mgr.add('domClick', domClick));

Constructor Parameters

… Core constructor parameters

Interface

Options

scope

Type: Object/Function Default: self Scope to be bound to the methods when add is called.

Properties

… Core properties

Methods

add

Parameters: name, listener [, scope] Return: Function Keeps track of the bound listener using a name, duplicates will override each other, returns the bound listener

get

Parameters: name Return: Function Returns the bound listener that corresponds with the given name

remove

Parameters: name Return: Function Removes the listener that corresponds with the given name, returns the found bound listener for further use outside of the manager.

destroy

Parameters: none Return: none Clears listener data and destroys the instance

Changelog

1.1.0

  • Corrected way of returning bound listeners on remove
  • Made properties private
  • Listener types changed to arrays for more intuitive listener management.

1.0.0

  • Creation of class

Keywords

FAQs

Package last updated on 19 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc