Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bidello

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bidello

Don't leave your Class alone

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

👨‍🏫 bidello

Don't leave your Class alone.

bidello is a simple class Mixin and event system.

How to use it

npm install bidello

and then

import { component } from 'bidello';

class YourClass extends component() {
  init() {
    //...
  }
}

And so?

You can extend your classes, and trigger methods by global events.

import bidello, { component } from 'bidello';

class YourClass extends component() {
  onResize({ width, height }) {

  }

  onVisibility({ visible }) {

  }

  onRaf() {

  }
};

// Anywhere else in your code...
bidello.trigger({ name: 'resize', fireAtStart: true }, {
  width: window.innerWidth,
  height: window.innerHeight,
});

bidello.trigger({ name: 'onVisibility' }, {
  visible: false,
});

bidello.trigger({ name: 'raf' });

The fireAtStart flag, if true, will force the onResize method to be called for any new classes created in the future (automatically passing the last known data)

Look at antipasto for a real example.

FAQs

Package last updated on 07 Aug 2019

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