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
var request = require('request'); | |
var fs = require('fs'); | |
// Note that we cannot use a try catch around all this :-( | |
request.get('https://s3.amazonaws.com/aaronblondeau/widgets/widgets.json', (err, response, body) => { | |
if(err) { | |
console.error(err); | |
} | |
var data = JSON.parse(body); | |
fs.writeFile('./widgets.json', JSON.stringify(data.widgets), (err) => { |
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
var Promise = require('bluebird'); | |
var request = require('request'); | |
var fs = require('fs'); | |
request_promise = Promise.promisify(request); | |
writeFile_promise = Promise.promisify(fs.writeFile); | |
request_promise('https://s3.amazonaws.com/aaronblondeau/widgets/widgets.json') | |
.then((response, body) => { | |
var data = JSON.parse(response.body); |
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
var Promise = require('bluebird'); | |
var request = require('request'); | |
var fs = require('fs'); | |
request_promise = Promise.promisify(request); | |
writeFile_promise = Promise.promisify(fs.writeFile); | |
Promise.coroutine(function* () { | |
try { |
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
var Promise = require('bluebird'); | |
var request = require('request'); | |
var fs = require('fs'); | |
request_promise = Promise.promisify(request); | |
writeFile_promise = Promise.promisify(fs.writeFile); | |
Promise.coroutine(function* () { | |
try { |
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 } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet |
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
Show hidden characters
{ | |
"presets": ["react-native"], | |
"plugins": ["transform-decorators-legacy"] | |
} |
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 {observable} from 'mobx'; | |
class ApplicationState { | |
@observable clicks = 0; | |
} | |
const state = new ApplicationState() | |
export default state |
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
/** | |
* where2ride React Native App | |
* https://github.com/aaronblondeau/where2ride | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
} from 'react-native'; |
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 } from 'react'; | |
import { | |
StyleSheet, | |
} from 'react-native'; | |
import { Container, Content, Button, Text } from 'native-base'; | |
import {observer} from 'mobx-react'; | |
import applicationState from '../ApplicationState' | |
@observer |
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 } from 'react'; | |
import { | |
StyleSheet, | |
} from 'react-native'; | |
import { Container, Content, Button, Text, Icon } from 'native-base'; | |
import {observer} from 'mobx-react'; | |
import applicationState from '../ApplicationState' | |
import { NavigationActions } from 'react-navigation' |
OlderNewer