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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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, Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './blank.css'; | |
import Details from './Details'; | |
import { | |
Panel, | |
Button, | |
PageHeader, | |
ControlLabel, | |
FormControl, |
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
// @flow | |
/* globals describe it expect */ | |
import Renderer from 'react-test-renderer' | |
/** @jsx convert */ | |
const convert = (component, props, children) => { | |
const args = { ...props, children } | |
return component(args) | |
} |
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
// Redux: | |
const INCREMENT = 'INCREMENT' | |
const increment = () => ({ type: INCREMENT }) | |
const DECREMENT = 'DECREMENT'; | |
const decrement = () => ({ type: DECREMENT }) | |
const count = (state = 0, action) => { | |
switch (action.type) { | |
case INCREMENT: { |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component, PureComponent } from 'react'; | |
import { | |
Platform, | |
Text, |
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 ifType = type => cb => item => typeof item === type ? cb(item) : item | |
const ifNumber = ifType('number') | |
const isDivisibleBy = divisor => num => num % divisor === 0 | |
const isFizz = isDivisibleBy(3) | |
const isBuzz = isDivisibleBy(5) | |
const isBang = isDivisibleBy(15) | |
const convert = predicate => converted => num => predicate(num) ? converted : num | |
const toFizz = convert(isFizz)('fizz') |
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 { Bodies, Body, Drawers, Drawer, Headers, Header, Router, Route, Tabs, Tab } from 'declarative-router' | |
import { Scene1, Scene2 } from './myScenes' | |
import { Main } from './myRoutes' | |
<Router>{(route) => | |
// ROUTES //////////////////////////////////////////////////////////////// | |
<Route isActive={route === 'main'}>{(scene) => | |
<Scene isActive={scene === '1'}> | |
// DRAWERS //////////////////////////////////////////////////////////////// | |
<Drawers> |
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
// Types /////////////////////////////////////////////////////////////////// | |
type BookId = string | |
type BookTitle = string | |
type BookAuthor = string | |
type BookRating = number | |
type AuthorName = string | |
type AuthorId = number | |
type Author = { | |
name: AuthorName, |
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
// @flow | |
import React, { Component } from 'react' | |
import type { Node } from 'react' | |
import { StyleSheet, Text, View } from 'react-native' | |
import { default as Modal } from 'react-native-modal' | |
import { styles } from './styles.js' | |
// CONTAINER ///////////////////////////////////////////////////////////////////////////// |
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
export type WalletId = string | |
export type CurrencyCode = string | |
export type IsoCurrencyCode = string | |
export type PluginName = string | |
export type SceneKey = string | |
export type SceneData = Object |
NewerOlder