This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint no-console: off */ | |
const http = require('http'); | |
const _ = require('lodash'); | |
const randomHttpStatusCode = _.sample(_.invert(http.STATUS_CODES)); | |
console.log('randomHttpStatusCode:', randomHttpStatusCode); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleChange(e) { | |
e.persist(); | |
// info: "this.debounced" is defined at the class level | |
if (!this.debounced) { | |
this.debounced = _.debounce(() => { | |
console.log('YATTA!'); | |
this.debounced.cancel(); | |
this.debounced = undefined; | |
}, 500); | |
this.debounced(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var you = true; | |
const MATTIA = 'Mattia'; | |
var myName = { | |
is: function(name) { | |
return name == MATTIA | |
} | |
}; | |
var to = { | |
call: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chai = require('chai'), | |
expect = chai.expect, | |
should = chai.should(); | |
describe('unit-tests', function () { | |
'use strict' | |
describe('generic-component-tests', function () { | |
describe('given a component', function () { | |
describe('when initialized w/ dependency', function () { |
NewerOlder