Temporarily disable rules
foo(); // eslint-disable-line
/* eslint-disable no-alert, no-console */
alert('foo');
console.log('bar');
/* eslint-enable no-alert, no-console */| function injectScript(src) { | |
| return new Promise(resolve => { | |
| const e = document.createElement("script"); | |
| e.src = src; | |
| e.onload = resolve; | |
| document.head.appendChild(e); | |
| }); | |
| } | |
| // Example usage |
| /** | |
| * Copyright (c) 2016, Tiernan Cridland | |
| * | |
| * Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby | |
| * granted, provided that the above copyright notice and this permission notice appear in all copies. | |
| * | |
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL | |
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
| * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |
| * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
Temporarily disable rules
foo(); // eslint-disable-line
/* eslint-disable no-alert, no-console */
alert('foo');
console.log('bar');
/* eslint-enable no-alert, no-console */| /** | |
| * Promise'd version of `gapi.load`. | |
| */ | |
| function gapiLoad<T>(s: string): Promise<T> { | |
| return new Promise((resolve, reject) => { | |
| if ("gapi" in window) { | |
| gapi.load(s, () => resolve(gapi[s])); | |
| } else { | |
| reject("window.gapi not found"); | |
| } |
| function gapiLoad(s) { | |
| return new Promise(r => { | |
| gapi.load(s, () => r(gapi[s])); | |
| }); | |
| } | |
| function getClient(s, v) { | |
| if (!v) v = 'v1'; | |
| return gapiLoad('client').then(client => { | |
| client.load(s, v).then(function() { |
| getGlobal('flags').then(flags => { | |
| flags['debug'] = true; | |
| flags['email'] = '[email protected]'; | |
| }); | |
| // sometime later | |
| getGlobal('flags').then(flags => { | |
| console.log(JSON.stringify(flags)); // -> {"debug":true,"email":"[email protected]"} | |
| }); |
| Promise.all([1, 2]).then(Object.apply.bind((a, b) => { console.log(`a = ${a}, b = ${b}`) }, null)) | |
| // -> a = 1, b = 2 |
I hereby claim:
To claim this, I am signing this object:
myproject).See .
| <link rel="import" href="../paper-tabs/paper-tabs.html"> | |
| <link rel="import" href="../paper-tabs/paper-tab.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; | |
| width: 100%; |