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' | |
const Waypoints = () => { | |
return ( | |
<div className="waypoints"> | |
<p> | |
Lorem ipsum dolor amet poutine pitchfork tattooed venmo, heirloom cliche chartreuse gentrify mumblecore hammock single-origin coffee banh mi. Sartorial unicorn 90's edison bulb iPhone. Leggings pickled brunch neutra tousled. Occupy fixie affogato pinterest vaporware aesthetic, tbh subway tile hammock next level prism vape lomo taiyaki kale chips. Jianbing knausgaard taxidermy squid artisan thundercats, gochujang subway tile air plant taiyaki master cleanse cray. | |
</p> | |
<p> | |
Pug godard pour-over 90's direct trade, PBR&B +1 next level organic edison bulb quinoa DIY. Taiyaki sriracha unicorn, cronut taxidermy chicharrones four dollar toast keytar cold-pressed raclette yuccie cray iceland. Roof party knausgaard neutra plaid, pork belly chambray banh mi chia. Blue bottle narwhal iceland health goth cornhole fam humblebrag flannel pitchfork pickled. |
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 { useRef, useState, useEffect } from 'react' | |
import ResizeObserver from 'resize-observer-polyfill' | |
export default function useMeasure() { | |
const ref = useRef() | |
const [bounds, set] = useState({ left: 0, top: 0, width: 0, height: 0 }) | |
const [ro] = useState(() => new ResizeObserver(([entry]) => set(entry.contentRect))) | |
useEffect(() => (ro.observe(ref.current), ro.disconnect), []) | |
return [{ ref }, bounds] | |
} |
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 as Router, Switch, Route, Link } from 'react-router-dom'; | |
const Routes = () => { | |
return ( | |
<Router> | |
<ul className="router-nav"> | |
<NavLink to="/">One</NavLink> | |
<NavLink to="/two">Two</NavLink> | |
<NavLink to="/three">Three</NavLink> |
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, { Component } from "react"; | |
export default class Refactor extends Component { | |
state = { | |
isToggled: false | |
}; | |
toggle = () => { | |
this.setState(state => { | |
return { isToggled: !state.isToggled }; |
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
Loadable.preloadAll() | |
.then(() => | |
onPageLoad(async sink => { | |
try { | |
const cache = new InMemoryCache(); | |
const stateLink = withClientState({ | |
cache, | |
resolvers: stateMutations, | |
defaults: defaultState, |
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 { StaticRouter } from 'react-router'; | |
import { ServerStyleSheet } from 'styled-components'; | |
import { onPageLoad } from 'meteor/server-render'; | |
// import { createApolloServer } from './apolloServer'; | |
import { createApolloServer } from 'meteor/apollo'; | |
import { Helmet } from 'react-helmet'; | |
import { SchemaLink } from 'apollo-link-schema'; | |
import 'isomorphic-fetch'; | |
// Apollo |
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 { makeExecutableSchema, addMockFunctionsToSchema } from 'graphql-tools'; | |
import { graphql } from 'graphql'; | |
import GraphQLMock from 'graphql-mock'; | |
import typeDefs from 'imports/startup/both/typeDefs'; | |
// Make a GraphQL schema with no resolvers | |
const schema = makeExecutableSchema({ typeDefs }); | |
// Creates random id | |
const revisedRandId = () => |
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
{ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, | |
"es6": true | |
}, | |
"settings": { | |
"ecmascript": 6, | |
"jsx": 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
const httpLink = new HttpLink({ uri: Meteor.absoluteUrl('graphql') }); | |
const authLink = new ApolloLink((operation, forward) => { | |
const token = Accounts._storedLoginToken(); // from local storage | |
operation.setContext(() => ({ | |
headers: { | |
'meteor-login-token': token, | |
}, | |
})); | |
return forward(operation); | |
}); |