This file contains hidden or 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 initialState = {} | |
const enhancers = [] | |
const middleware = [ | |
thunk, | |
routerMiddleware(history) | |
] | |
const composedEnhancers = compose( |
This file contains hidden or 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 logger({ getState }) { | |
return (next) => (action) => { | |
console.log('will dispatch', action) | |
return returnValue | |
} | |
} | |
const initialState = {} | |
const enhancers = [] | |
const middleware = [ |
This file contains hidden or 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 logger({ getState }) { | |
return (next) => (action) => { | |
console.log('will dispatch', action) | |
return returnValue | |
} | |
} | |
const initialState = {} | |
const enhancers = [] | |
const middleware = [ |
This file contains hidden or 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
//Explicit vs. Implicit Coercion in JS | |
let a = 100; | |
let b = a + ''; //IMPLICIT COERCION | |
console.log(b) //'100' | |
let c = String ( a ) //EXPLICIT COERCION | |
console.log(c) //'100' |
This file contains hidden or 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 { AppRegistry } from "react-native"; | |
import App from "./components/App"; | |
AppRegistry.registerComponent("App", () => App); | |
AppRegistry.runApplication("App", { | |
rootTag: document.getElementById("root") | |
}); |
This file contains hidden or 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 { Image, Text, View, Button, Picker } from "react-native"; | |
import { styles } from "../utils/styles"; | |
import SomeCustomComponent from "./SomeCustomComponent"; | |
// see https://github.com/necolas/react-native-web | |
class App extends Component { | |
_onButtonPress() { | |
//do some things |
This file contains hidden or 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 makeIterator(array) { | |
var nextIndex = 0; | |
console.log("nextIndex =>", nextIndex); | |
return { | |
next: function() { | |
return nextIndex < array.length | |
? { value: array[nextIndex++], done: false } | |
: { done: true }; | |
} |
This file contains hidden or 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* sample() { | |
yield "simple"; | |
yield "generator"; | |
} | |
var it = sample(); | |
console.log(it.next()); // {value: 'simple, done: false} | |
console.log(it.next()); // {value: 'generator, done: false} | |
console.log(it.next()); // {value: undefined, done: true} |
This file contains hidden or 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* favBeer() { | |
const reply = yield "What is your favorite type of beer?"; | |
console.log(reply); | |
if (reply !== "ipa") return "No soup for you!"; | |
return "OK, soup."; | |
} | |
{ | |
const it = favBeer(); | |
const q = it.next().value; // Iterator asks question |
This file contains hidden or 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 TaskNode(task) { | |
this.taskName = task.name; | |
this.taskUri = task.id | |
this.nextTask = null; | |
this.previousTask = null; | |
} | |
function WorkflowTaskLinkedList() { | |
this.head = new TaskNode({name:"head",id:'http://123'}); | |
this.find = find; |