Skip to content

Instantly share code, notes, and snippets.

import _fetch from 'isomorphic-fetch'
import checkStatus from '../src/utils/check-status'
import parseBody from '../src/utils/parse-body'
import jsonFile from 'jsonfile'
let cache = {}
const cachePath = __dirname + '/cache.json'
export default function fetch (url, ignoreCache = false) {
if (!ignoreCache) {
import fetch from 'isomorphic-fetch'
import QS from 'qs'
const URL_PREFIX = 'https://www.googleapis.com/youtube/v3'
const PLAYLIST_ID = 'UUANLZYMidaCbLQFWXBC95Jg'
const API_KEY = 'XXX'
const DEFAULT_PART = 'contentDetails'
const DEFAULT_MAX_RESULTS = '50'
function buildUrl(path, params) {
{ type: 'FETCH_POSTS' }
{ type: 'FETCH_POSTS', status: 'error', error: 'Oops' }
{ type: 'FETCH_POSTS', status: 'success', response: { ... } }
70-odd
able
above
abreast
abrupt
absent
abstracted
absurd
accessible
accident
var _ = require('lodash');
var fs = require('fs');
var path = require('path');
var byline = require('byline');
var anagrams = {}, matchers = [];
function findAnagrams (filePath, cb) {
byline(fs.createReadStream(filePath, { encoding: 'utf8' }))
.on('data', process)
const d3 = { svg: { axis: d3axis } };
function noop(x) { console.log('called with', x); return d3axis(); }
function d3axis() { return { scale: noop, range: noop } }
class Axis {
constructor(obj) {
this.props = obj || {};
}
render() {
jest.dontMock('../');
function noop() {}
describe('React Router Context Test', function() {
var React, Router, TestUtils, stubContext, TestHandler;
beforeEach(function() {
React = require.requireActual('react/addons');
TestUtils = React.addons.TestUtils;
var React = require('react');
var assign = require('object-assign');
function createStubbedContextComponent(BaseComponent, context) {
var _contextTypes = {}, _context = context;
Object.keys(_context).forEach(function(key) {
_contextTypes[key] = React.PropTypes.any;
});
var React = require.requireActual('react')
var assign = require.requireActual('object-assign')
function stubContext(Component, context) {
var _component = Component
var _context = context
var _contextTypes = {}
Object.keys(_context).forEach((key) => {
_contextTypes[key] = React.PropTypes.any
var React = require.requireActual('react')
var assign = require.requireActual('object-assign')
function stubContext(Component, context, props) {
var _component = Component
var _context = context
var _props = props
var _contextTypes = {}
Object.keys(_context).forEach((key) => {