This file contains 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, { PureComponent } from 'react' | |
import { render } from 'react-dom' | |
const styles = { | |
fontFamily: 'sans-serif', | |
textAlign: 'center', | |
} | |
class App extends PureComponent { |
This file contains 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 Service, { Router } from '@eaze/service' | |
import { auth, isAdmin } from '@eaze/middleware' | |
class Acacia extends Service { | |
static router () { | |
return ( | |
<Router> | |
<Get route='/products' handler={(req, res) => res.send(200)} /> | |
<Post route='/products/create' middleware={[ isAdmin ]} handler={(req, res) => res.send(200)} /> | |
<Patch route='/products/:id' middleware={[ isAdmin ]} handler={(req, res) => res.send(200)} /> |
This file contains 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 { PureComponent, Fragment } from 'react' | |
import hoistNonReactStatic from 'hoist-non-react-statics' | |
import MaintenanceMode from 'pages/maintenance' | |
export default function hasNotification (Component) { | |
class withNotifications extends PureComponent { | |
state = { | |
alert: '' | |
} |
This file contains 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
'use strict' | |
const fs = require('fs') | |
const path = require('path') | |
const precache = require('./precache.js') | |
module.exports = class WebpackPlugin { | |
constructor (opts) { | |
this.opts = Object.assign({ | |
filename: 'service-worker.js', |
This file contains 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
class Emitter { | |
constructor () { | |
this.fns = {} | |
this.on = this.on.bind(this) | |
this.broadcast = this.broadcast.bind(this) | |
} | |
on (name, fn) { | |
if (this.fns[name]) { | |
this.fns[name].push(fn) |
This file contains 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
const pify = fn => (...args) => new Promise((resolve, reject) => fn(...args, (err, res) => err ? reject(err) : resolve(res))) |
This file contains 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, { PureComponent } from 'react' | |
import FlickList from 'react-flick-list' | |
import style from './style.css' | |
export default class HorizontalDrag extends PureComponent { | |
state = { | |
begin: { | |
x: 0, | |
y: 0 |
This file contains 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 { PureComponent } from 'react' | |
import { connect } from 'react-redux' | |
import hoistNonReactStatic from 'hoist-non-react-statics' | |
import { fetchCurrentAddress } from 'actions/location' | |
const mapDispatchToProps = dispatch => {{ | |
fetchCurrentAddress: () => dispatch(fetchCurrentAddress()) | |
}) |
This file contains 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 { PureComponent } from 'react' | |
import hoistNonReactStatic from 'hoist-non-react-statics' | |
import Firebase from 'firebase' | |
import { FIREBASE } from 'environment' | |
import MaintenanceMode from 'pages/maintenance' | |
export default function withMaintenance (WrappedComponent) { | |
class withMaintenanceComponent extends PureComponent { | |
state = { |
This file contains 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 { PureComponent } from 'react' | |
import requestIdle from 'request-callback' | |
import 'isomorphic-fetch' | |
import { withRouter } from 'next/router' | |
import OldLanding from './landing' | |
import NewLanding from './home' | |
import Connect from 'hocs/connect' | |
import withOptimizely from 'hocs/optimizely' |