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

mudecotex

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mudecotex

Introducing decorators to control synchronisity

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mudecotex

#Example

import {surpressedBy, mutex}     from 'mudecotex';

class Demo {

    constructor(){
        this.doStuff();
        this.foo();
    }

    @mutex('a')
    doStuff() {
        console.log('Doing some stuff.');
        this.doMoreStuff();
        console.log('Done doing stuff!');
    }


    @mutex('a')
    doMoreStuff(){
        console.log('Doing more stuff.');
        this.doFinalStuff();
        console.log('Done doing more stuff!');
    }

    @surpressedBy('foo')
    @mutex('a')
    doFinalStuff(){
        console.log('Doing final stuff.');
        console.log('Done final stuff!');
    }

    foo(){
        console.log('In foo, calling doFinalStuff');
        this.doFinalStuff();
        console.log('Done. Calling doFinalStuff had no effect');
    }

}


let main = new Demo();

Output:

Doing some stuff.
Done doing stuff!
Doing more stuff.
Done doing more stuff!
Doing final stuff.
Done final stuff!
In foo, calling doFinalStuff
Done. Calling doFinalStuff had no effect

FAQs

Package last updated on 25 Jan 2016

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