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
// USAGE: | |
// import LoadContent from './load-content.js'; | |
// LoadContent.Load($('#myDiv'), 'http://myContent.php', { id:1, data:mydata }, callbackFunction); | |
// DEPENDANCIES: jQuery, Babel ES6 | |
"use strict"; | |
/* | |
* CLASS: LoadContent | |
* DESC: Load php/html/* content into a div via jQuery | |
*/ |
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
/* | |
* Flatten deeply nested array without external library like Immutable | |
* Simplified ES6 version of lodash flattenDeep functionality | |
* Reference: https://lodash.com/docs#flattenDeep | |
* Requirements: Latest Chrome/FF browser or ES6 transpiler like Babel | |
*/ | |
const INFINITY = 1 / 0 | |
/* | |
* Utility flatten array function |
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
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
// async function | |
async function fetchAsync () { | |
// await response of fetch call | |
let response = await fetch('https://api.github.com'); | |
// only proceed once promise is resolved | |
let data = await response.json(); | |
// only proceed once second promise is resolved |
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
/* | |
INIT: ensure Babel/Eslint/Flow is configured for ES Class Fields & Static Properties | |
JSX USAGE: <Iframe src='http://web.site' onLoad={myOnloadFunction}/> | |
*/ | |
import React, { Component, PropTypes } from 'react' | |
import ReactDOM from 'react-dom' | |
class Iframe extends Component { | |
static propTypes: Object = { |
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
// VERSIONS | |
// "react-native": "0.63.3" | |
// "react-native-iap": "5.1.3" | |
// "react-native-iaphub": "6.0.3" | |
// OUR CODE | |
import Iaphub from 'react-native-iaphub'; | |
// APP INIT | |
const iaphubInit = async () => { |