One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| function mockServerCall () { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| resolve({ | |
| 'status': 200, | |
| 'content-type': 'application/json', | |
| 'data' : { | |
| dataOfInterest: 42 | |
| } | |
| }) |
| # mount volume PWD on host to /app in container. | |
| shai@lappy ~/tmp/example-working-docker-compose-environment-vars [master *] ± % cat docker-compose.yml | |
| version: "3" | |
| services: | |
| some_server: | |
| ... | |
| volumes: | |
| - $PWD:/app |
| 'use strict'; | |
| import PushNotification from "react-native-push-notification"; | |
| let _pushNotificationToken = null; | |
| const _pushNotificationListeners = []; | |
| function init() { | |
| console.log("PushNotification init"); |
| // Promise.all is good for executing many promises at once | |
| Promise.all([ | |
| promise1, | |
| promise2 | |
| ]); | |
| // Promise.resolve is good for wrapping synchronous code | |
| Promise.resolve().then(function () { | |
| if (somethingIsNotRight()) { | |
| throw new Error("I will be rejected asynchronously!"); |