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 { graphql } from 'graphql'; | |
import schema from './your_schema_path'; | |
import type { VariablesOf, GraphQLTaggedNode } from 'react-relay'; | |
import type { | |
ConcreteRequest, | |
PayloadData, | |
OperationType, | |
} from 'relay-runtime'; | |
export type ServerQuery<TQuery extends OperationType> = { |
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, PropTypes } from 'react'; | |
import { | |
TouchableWithoutFeedback, | |
ScrollView, | |
View, | |
TextInput, | |
Keyboard, | |
findNodeHandle, | |
UIManager, |
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, { PropTypes } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
NavigationExperimental, | |
} from 'react-native'; | |
import { MemoryRouter as Router } from 'react-router'; | |
import { Stack, StackMatch, Link } from './stack'; |
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
function quadraticBezier(t, p0, p1, p2) { | |
const x = (1 - t) * (1 - t) * p0.x + 2 * (1 - t) * t * p1.x + t * t * p2.x; | |
const y = (1 - t) * (1 - t) * p0.y + 2 * (1 - t) * t * p1.y + t * t * p2.y; | |
return { x, y }; | |
} | |
const computeMiddle = ({ x: x1, y: y1 }, { x: x2, y: y2 }) => ({ | |
x: (x1 + x2) / 2, | |
y: (y1 + y2) / 2, |
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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { StyleSheet, createStylesRenderer } from 'vstyle'; | |
import { StylesRendererProvider, withRenderStyles } from 'react-vstyle'; | |
function createComponent({ component = 'div', ...styles }) { | |
const styleSheetDef = { | |
baseRule: {}, | |
}; |
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, { Component, PropTypes } from 'react'; | |
import { Route, IndexRoute, Link } from 'react-router'; | |
const styles = { | |
app: { | |
display: 'flex', | |
justifyContent: 'center', | |
}, | |
sideBar: { | |
marginRight: 10, |
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'; | |
var Rx = require('rx'); | |
var React = require('react'); | |
var React = require('react'); | |
var Component = require('./Component'); | |
var utils = require('./utils'); | |
var inherits = utils.inherits; | |
var isObservable = utils.isObservable; | |
var flatten = utils.flatten; |
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 from 'react'; | |
import { container } from 'redux-relay'; | |
@container({ | |
variablesFromState: (state) => ({myVariable: state.myState}) | |
fragments: { | |
Relay.QL` | |
viewer { |
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
@In((a: string, b: string) => { | |
assert(typeof a === 'string'); | |
assert(typeof b === 'string'); | |
assert(a.length > 5); | |
assert(a.length > 7); | |
}) | |
@Out((result: string) => { | |
assert(typeof result === 'string'); | |
assert(a.length > 12); | |
}) |
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 {FuncSubject} from 'rx-react'; | |
import {Observable} from 'rx'; | |
/** | |
* Component are just expressed with single function that return an | |
* RxReact Component instance, instead of taking the props object | |
* as argument, they take an observable of props. | |
* | |
* By default *shouldComponentUpdate* is the one from PureRenderMixin | |
*/ |
NewerOlder