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
| import React from 'react' | |
| import { BrowserRouter, Route } from 'react-router-dom' | |
| import Home from './Home' | |
| import About from './About' | |
| import Topics from './Topics' | |
| const App = () => | |
| <BrowserRouter> | |
| <div> | |
| <ul> |
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
| // 'a' will be part of my main chunk | |
| import a from 'a' | |
| // 'b' will be loaded from another chunk | |
| import('b').then(b => { | |
| console.log(`hello ${a} ${b}`) | |
| }) |
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
| import { asyncComponent } from 'loadable-components' | |
| export const Home = asyncComponent(() => import('client/Home')) |
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
| import { Component } from 'react' | |
| import createEagerFactory from './createEagerFactory' | |
| import createHelper from './createHelper' | |
| const mapValues = (obj, func) => { | |
| const result = [] | |
| let i = 0 | |
| /* eslint-disable no-restricted-syntax */ | |
| for (const key in obj) { | |
| if (obj.hasOwnProperty(key)) { |
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
| import React from 'react'; | |
| import identity from './identity'; | |
| import createHelper from 'recompose/createHelper'; | |
| import createEagerElement from 'recompose/createEagerElement'; | |
| export default createHelper((Wrapper, mapProps) => Component => props => { | |
| mapProps = mapProps || identity; | |
| return ( | |
| <Wrapper {...mapProps(props)}> | |
| {createEagerElement(Component, props)} |
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 gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var watchify = require('watchify'); | |
| var uglify = require('gulp-uglify'); | |
| var buffer = require('vinyl-buffer'); | |
| var source = require('vinyl-source-stream'); | |
| var browserify = require('browserify'); | |
| var browserSync = require('browser-sync'); | |
| var sass = require('gulp-ruby-sass'); | |
| var filter = require('gulp-filter'); |
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
| { | |
| "env": { | |
| "browser": true, | |
| "node": true, | |
| "mocha": true | |
| }, | |
| "globals": { | |
| "angular": false, | |
| "Promise": true |
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 minimist = require('minimist'); | |
| var path = require('path'); | |
| var yaml = require('js-yaml'); | |
| var fs = require('fs'); | |
| var defaultsDeep = require('merge-defaults'); | |
| /** | |
| * Define config path. | |
| */ |
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
| describe('My directive', function () { | |
| var scope, $compile; | |
| beforeEach(module('app.directives')); | |
| beforeEach(inject(function ($injector) { | |
| $compile = $injector.get('$compile'); | |
| var $rootScope = $injector.get('$rootScope'); | |
| scope = $rootScope.$new(); |