As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
class Foo { | |
constructor($http, $log, WhateverElse) { | |
// This is the boilerplate I'm talking about | |
this.$http = $http; | |
this.$log = $log; | |
this.whateverElse = WhateverElse; | |
// anytime I add something, I have to add it here | |
// anytime I remove something, I have to remove it from here | |
// I just don't really see what classes are getting me from | |
// a reusability/maintainability/readability/whatever standpoint. |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
'use strict'; | |
import Singleton from 'Singleton'; | |
class ClassA extends Singleton { | |
constructor() { | |
super(); | |
} | |
singletonMethod1() { | |
// ... |
const fnPromisified = (arg) => new Promise((resolve, reject) => | |
fnTakingCallback(arg, (err, res) => { | |
if (err) { | |
return reject(err) | |
} | |
return resolve(res) | |
}) | |
) |