Tracker.autorun(func, { subscriptionsReady: [‘posts’, ‘comments’], isTrue: () => Session.get(‘foo’) userIs: ‘admin’ templateIsVisible: ‘AllPosts’ });
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
| var express = require(‘express’); | |
| var app = express(); | |
| app.get(‘/’, function (req, res) { | |
| res.send(‘Hello World!’); | |
| }); | |
| var server = app.listen(3000, function () { | |
| var host = server.address().address; | |
| var port = server.address().port; |
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 * as actions from './actions'; | |
| class MyComponent extends React.Component { | |
| componentWillMount() { | |
| this.props.subscribe('posts', [categoryId, limit, page}); | |
| } | |
| render() { | |
| <View> | |
| {this.props.posts.map((post) => <View><Text>{post.title}</Text</View>)} |
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 Twit = Meteor.npmRequire('twit'); | |
| Accounts.registerLoginHandler('twitter', function(params) { | |
| const data = params.twitter; | |
| // If this isn't twitter login then we don't care about it. No need to proceed. | |
| if (!data) { | |
| return undefined; | |
| } |
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'; | |
| import { | |
| Text, | |
| View, | |
| Image, | |
| Animated, | |
| Easing, | |
| } from 'react-native'; | |
| const ALL_PROPERTIES = ['translateX', 'translateY', 'translateZ', 'rotateX', 'rotateY', 'rotateZ', 'scale']; |
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' | |
| import { | |
| View, | |
| ActivityIndicator, | |
| StyleSheet, | |
| } from 'react-native' | |
| export default class Image extends Component { |
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 * as css from './css'; | |
| import createReactStyleObject from './createReactStyleObject'; | |
| import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment'; | |
| import flattenStyle from '../../modules/flattenStyle'; | |
| import React from 'react'; | |
| import ReactNativePropRegistry from '../../modules/ReactNativePropRegistry'; | |
| import StyleSheetValidation from './StyleSheetValidation'; | |
| import jss from 'jss' | |
| import preset from 'jss-preset-default' |
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 isEqual from 'lodash/isEqual'; | |
| function RouteTransitionGroup() { | |
| let {children, location} = this.props; | |
| let {type, payload, pathname} = location; | |
| children = React.Children.toArray(children) | |
| .filter(child => isChildMatch(child, location)); |
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
| a = next => action => { console.log('a1'); action = next(action+'A'); console.log('a2'); return action+'a' } | |
| b = next => action => { console.log('b1'); action = next(action+'B'); console.log('b2'); return action+'b' } | |
| c = next => action => { console.log('c1'); action = next(action+'C'); console.log('c2'); return action+'c' } | |
| funcs = [a, b, c] | |
| dispatch = funcs.reduce((a, b) => (...args) => a(b(...args)))(action => { console.log('BEFORE'); return action; }) | |
| dispatch('FOO') | |
| a = next => { console.log('A ACTION'); return (action) => { console.log('a1'); action = next(action+'A'); console.log('a2'); return action+'a'; }; } | |
| b = next => { console.log('B ACTION'); return (action) => { console.log('b1'); action = next(action+'B'); console.log('b2'); return action+'b'; }; } |
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 { NOT_FOUND } from '../index' | |
| import isServer from '../pure-utils/isServer' | |
| import { nestHistory } from '../pure-utils/nestAction' | |
| import type { | |
| LocationState, | |
| RoutesMap, | |
| Action, | |
| Payload, | |
| History |