View index.js
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 WebSocketServer = require('ws').Server | |
, wss = new WebSocketServer({ port: 8083 }); | |
wss.on('connection', function connection(ws) { | |
ws.on('message', function incoming(message) { | |
console.log('received: %s', message); | |
// ws.send("message"); | |
ws.send(message); | |
}); |
View picker.js
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 { | |
TouchableHighlight, | |
TouchableOpacity, | |
Image, | |
ImageBackground, | |
View, | |
Text, | |
StatusBar, | |
ScrollView, |
View page
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 { | |
TouchableOpacity, | |
Image, | |
View, | |
Text, | |
StatusBar, | |
ScrollView, | |
Dimensions, |
View List
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, { PureComponent } from 'react'; | |
import { TouchableHighlight, Image, Dimensions } from 'react-native'; | |
const { width }: { width: number } = Dimensions.get('window'); | |
type node = { node: { image: { uri: string } } }; | |
type State = {}; | |
type Props = { | |
item: node, |
View ListItem.js
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 { Dimensions, Animated, Text, View } from "react-native"; | |
const { height, width } = Dimensions.get("window"); | |
export default class ListItem extends Component { | |
constructor(props) { | |
super(props); | |
this.show = new Animated.Value(0); | |
} | |
componentDidMount() { |
View app1.js
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, { useState } from "react"; | |
function useInput(initialValue) { | |
const [value, setValue] = useState(initialValue); | |
function handleChange(e) { | |
setValue(e.target.value); | |
} | |
return { | |
value, | |
onChange: handleChange |
View index.js
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 users = require("./users"); | |
const posts = require("./posts"); | |
module.exports = { | |
users, | |
posts: posts(), | |
}; |