Wondering what’s next for npm?Check out our public roadmap! »

    @boost/decorators
    TypeScript icon, indicating that this package has built-in type declarations

    2.1.2 • Public • Published

    Decorators - Boost

    Build Status npm version npm deps

    Experimental decorators for common patterns.

    import { Bind, Memoize } from '@boost/decorators';
    
    class Example {
      @Bind()
      referencedMethod() {
        return this; // Class instance
      }
    
      @Memoize()
      someExpensiveOperation() {
        // Do something heavy
      }
    }

    Features

    • @Bind - Autobind a method's this to the class context.
    • @Debounce - Defer the execution of a method in milliseconds.
    • @Deprecate - Mark a property, method, or class as deprecated.
    • @Memoize - Cache and return the result of a method execution.
    • @Throttle - Throttle the execution of a method to a timeframe in milliseconds.

    Installation

    yarn add @boost/decorators
    

    Documentation

    https://boostlib.dev/docs/decorators

    Install

    npm i @boost/decorators

    DownloadsWeekly Downloads

    1,344

    Version

    2.1.2

    License

    MIT

    Unpacked Size

    65.7 kB

    Total Files

    48

    Last publish

    Collaborators

    • avatar