Sample of how to use redux:
will generate App/Redux/UserRedux.js will generate App/Sagas/UserSagas.js
| // Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/ | |
| $ git add . | |
| $ git status // to see what changes are going to be commited | |
| $ git commit -m 'Some descriptive commit message' | |
| $ git push origin master | |
| $ git checkout gh-pages // go to the gh-pages branch | |
| $ git rebase master // bring gh-pages up to date with master | |
| $ git push origin gh-pages // commit the changes |
| import Config from '../Config/DebugConfig' | |
| import Immutable from 'seamless-immutable' | |
| import Reactotron from 'reactotron-react-native' | |
| import { reactotronRedux } from 'reactotron-redux' | |
| import sagaPlugin from 'reactotron-redux-saga' | |
| var store; | |
| if (Config.useReactotron) { | |
| Reactotron |
| cd /home/henrique/ | |
| sudo apt-get install unzip | |
| wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
| unzip sdk-tools-linux-4333796.zip -d Android | |
| rm sdk-tools-linux-4333796.zip | |
| apt install openjdk-8-jre-headless | |
| export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 | |
| export PATH=$PATH:$JAVA_HOME/bin | |
| printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc | |
| cd Android/tools/bin |
| # create assets folder in the current project | |
| $ mkdir android/app/src/main/assets | |
| # create bundle script | |
| $ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ | |
| # execute command to run android to create debug apk | |
| $ react-native run-android | |
| # Or change to android folder |
| // Use hacker news API as example | |
| async function getData() { | |
| const ids = await (await fetch('https://hacker-news.firebaseio.com/v0/topstories.json')).json() | |
| const data = Promise.all( | |
| ids.map(async (i) => await (await fetch(`https://hacker-news.firebaseio.com/v0/item/${i}.json?print=pretty`)).json()) | |
| ) | |
| return data | |
| } | |
| getData() |
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |