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 class CoffeeBrewer{ | |
constructor(name) { | |
this.beanName = name; | |
} | |
brew = () => { | |
console.log("brewing...", this.beanName); | |
} | |
} |
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 const AnotherCoffeeComponent = props => { | |
const { coffeeBrewer: { brew } } = props; | |
return ( | |
<TouchableView | |
onPress={brew} | |
> | |
<Text>Press me!</Text> | |
</TouchableView> | |
); |
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 const CoffeeComponent = (props) => { | |
const coffeeBrewer = new CoffeeBrewer("DarkRoast"); | |
return ( | |
<TouchableView | |
onPress={() => { | |
coffeeBrewer.brew(); | |
}}> | |
<Text>Press me!</Text> | |
</TouchableView> |
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 class CoffeeBrewer{ | |
constructor(name) { | |
this.beanName = name; | |
} | |
brew() { | |
console.log("brewing...", this.beanName); | |
} | |
} |
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
# /usr/local/etc/bash_completion.d | |
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home" | |
export ANDROID_HOME="/Users/bramdoss/Library/Android/sdk" | |
export PATH=$PATH:$ANDROID_HOME/emulator | |
export PATH=$PATH:$ANDROID_HOME/tools | |
export PATH=$PATH:$ANDROID_HOME/tools/bin | |
export PATH=$PATH:$ANDROID_HOME/platform-tools | |
export PATH="$PATH:$JAVA_HOME/bin" |
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 UnsplashFeed = props => { | |
const [photos, fetchMore] = useUnsplashPhotos('dogs'); | |
const renderItem = ({ item, index }) => { | |
const { uri } = item; | |
return ( | |
<Image | |
source={{ | |
uri, | |
}} |
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 useUnsplashPhotos(keyword) { | |
const [page, setPage] = useState(1); | |
// default this to true to kick the initial effect hook to | |
// fetch the first page | |
const [shouldFetch, setShouldFetch] = useState(true); | |
const [photos, setPhotos] = useState([]); | |
// return this function for Flatlist to call onEndReached | |
const fetchMore = useCallback(() => setShouldFetch(true), []); |
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 Unsplash, { toJson } from 'unsplash-js'; | |
const unsplashInstance = new Unsplash({ | |
secret: 'Your secret here', | |
accessKey: 'Your accessKey here', | |
}); | |
async function fetchPhotos(keyword, page, limit = 10) { | |
const photoResult = await unsplashInstance.search | |
.photos(keyword, page, limit) |
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
"android": { | |
"sourceDir": "/Users/bala/sample-app/Sample/node_modules/react-native-ble-manager/android", | |
"folder": "/Users/bala/sample-app/Sample/node_modules/react-native-ble-manager", | |
"packageImportPath": "import it.innove.BleManagerPackage;", | |
"packageInstance": "new BleManagerPackage()" | |
} |
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
$ npx react-native config | |
{ | |
"root": "/Users/bala/sample-app/Sample", | |
"reactNativePath": "/Users/bala/sample-app/Sample/node_modules/react-native", | |
"dependencies": { | |
"react-native-ble-manager": { | |
"root": "/Users/bala/sample-app/Sample/node_modules/react-native-ble-manager", | |
"name": "react-native-ble-manager", | |
"platforms": { | |
"android": { |
NewerOlder