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 decamelize from 'decamelize'; | |
import { fromGlobalId } from 'graphql-relay'; | |
import pluralize from 'pluralize'; | |
import getItem from '../api/getItem'; | |
const types = {}; | |
const endpoints = {}; | |
const getItemOverrides = {}; |
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
// Define your components like: | |
class MyComponent extends React.Component { | |
static fetchData = (params) => { | |
// return an action here. | |
}; | |
/* ... */ | |
} | |
function fetchComponentData(component, store, params) { |
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
class Post { | |
static Resource = HttpResource; | |
static resourceConfig = { endpoint: '/posts' }; | |
@field({ required: true })) | |
title = 'untitled'; | |
@field() | |
text = ''; |
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 Benchmark = require('benchmark'); | |
const _ = require('lodash'); | |
const props = { | |
className: 'foo', | |
onClick: () => null, | |
children: 'bar', | |
style: { top: 10 }, | |
relay: {}, | |
intl: {}, |
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) { |
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
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
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
import io from 'socket.io-client'; | |
import RelayNetworkLayer from '@taion/relay-network-layer'; | |
const MAX_SUBSCRIPTIONS = 200; | |
const EMPTY_SUBSCRIPTION = { | |
dispose() {}, | |
}; | |
/** |
OlderNewer