Socket
Socket
Sign inDemoInstall

@open-wc/dedupe-mixin

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@open-wc/dedupe-mixin

Dedupe JavaScript Class Mixins


Version published
Weekly downloads
137K
decreased by-0.03%
Maintainers
2
Weekly downloads
 
Created

What is @open-wc/dedupe-mixin?

@open-wc/dedupe-mixin is a utility for creating mixins in JavaScript that ensures the mixin is only applied once, even if it is included multiple times in the inheritance chain. This is particularly useful in web component development where mixins are often used to add reusable functionality to components.

What are @open-wc/dedupe-mixin's main functionalities?

DedupeMixin

The DedupeMixin function ensures that the mixin is only applied once, even if it is included multiple times in the inheritance chain. In this example, the mixin logs a message when it is applied.

const dedupeMixin = (superclass) => class extends superclass {
  constructor() {
    super();
    console.log('DedupeMixin applied');
  }
};

class BaseClass {}

class MixedClass extends dedupeMixin(BaseClass) {}

const instance = new MixedClass();

Other packages similar to @open-wc/dedupe-mixin

Keywords

FAQs

Package last updated on 24 Mar 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