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
// You can imagine some shorthand for generating this given a component and | |
// a Relay query. | |
import React from 'react'; | |
import getFoo from './getFoo'; | |
import lazyComponent from './lazyComponent'; | |
export default function fooEntrypoint({ fooId }) { | |
const Component = lazyComponent(import('Foo')); |
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 isEqual from 'lodash/isEqual'; | |
import { useContext, useEffect, useRef } from 'react'; | |
import { ReactRelayContext, requestSubscription } from 'react-relay'; | |
import { | |
GraphQLSubscriptionConfig, | |
GraphQLTaggedNode, | |
OperationType, | |
} from 'relay-runtime'; | |
import useCommittedRef from '@restart/hooks/useCommittedRef'; | |
import usePrevious from '@restart/hooks/usePrevious'; |
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 HttpError from 'found/lib/HttpError'; | |
import BaseRoute from 'found/lib/Route'; | |
import React from 'react'; | |
import LoadingIndicator from '@bfly/ui/lib/LoadingIndicator'; | |
function defaultGetDataFrom({ location }) { | |
return location.action === 'POP' ? 'STORE_OR_NETWORK' : 'STORE_THEN_NETWORK'; | |
} | |
export function createRender({ prerender, render, renderFetched }) { |
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
[[source]] | |
url = "https://pypi.python.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
flask = "*" |
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 io from 'socket.io-client'; | |
import RelayNetworkLayer from '@taion/relay-network-layer'; | |
const MAX_SUBSCRIPTIONS = 200; | |
const EMPTY_SUBSCRIPTION = { | |
dispose() {}, | |
}; | |
/** |
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 Relay from 'react-relay'; | |
export default function runQuery( | |
queryNode, | |
args, | |
environment, | |
forceFetch = false, | |
) { | |
const query = Relay.createQuery(queryNode, args); |
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 redisClient = redis.createClient(REDIS_URL); | |
const listeners = Object.create(null); | |
function addListener(channel, listener) { | |
if (!listeners[channel]) { | |
listeners[channel] = []; | |
redisClient.subscribe(channel); | |
} | |
listeners[channel].push(listener); |
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
/* @flow */ | |
import { GraphQLNonNull } from 'graphql'; | |
export default function makeRequired(partial?: boolean) { | |
if (partial) { | |
return (type: mixed) => type; | |
} | |
return (type: mixed) => new GraphQLNonNull(type); |
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 invariant from 'invariant'; | |
import React from 'react'; | |
import BaseRoute from 'react-router/lib/Route'; | |
import LoadingIndicator from './LoadingIndicator'; | |
// This is not a component. | |
/* eslint-disable react/prop-types */ | |
function render({ props, element }) { | |
if (!props) { |
NewerOlder