How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • var emitter= new EventEmitter2();
    
    EventEmitter2.once(emitter, 'event', {
        timeout: 0,
        Promise: Promise, // a custom Promise constructor
        overload: false // overload promise cancellation api if exists with library implementation
    }).then(function(data){
        console.log(data); // [1, 2, 3]
    });
    
    emitter.emit('event', 1, 2, 3);
    Docs
  • import { Component, EventEmitter, Input, Output } from '@angular/core';
    
    @Component({
      selector: 'app-voter',
      template: `
        <h4>{{name}}</h4>
        <button type="button" (click)="vote(true)"  [disabled]="didVote">Agree</button>
        <button type="button" (click)="vote(false)" [disabled]="didVote">Disagree</button>
      `
    })
    export class VoterComponent {
      @Input()  name = '';
      @Output() voted = new EventEmitter<boolean>();
      didVote = false;
    
      vote(agreed: boolean) {
        this.voted.emit(agreed);
        this.didVote = true;
      }
    }
    Docs
  • var emitter= new EventEmitter2({
        wildcard: true
    });
    emitter.on('a.b.c', function(){});
    emitter.on(['z', 'x', 'c'], function(){});
    console.log(emitter.eventNames()) // [ 'z.x.c', 'a.b.c' ]
    Docs
  • var EventEmitter2= require('eventemitter2');
    var emitter= new EventEmitter2();
    
    emitter.on('event', function(){
        console.log('The event was raised!');
    }, {async: true});
    
    emitter.emit('event');
    console.log('emitted');
    Docs
  • var emitter= new EventEmitter2({
        wildcard: true
    });
    emitter.on('a.b.c', function(){});
    emitter.on(['z', 'x', Symbol()], function(){});
    console.log(emitter.eventNames()) // [ [ 'z', 'x', Symbol() ], 'a.b.c' ]
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples