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 loggedIn() { | |
// ... | |
} | |
function requireAuth(nextState, replace) { | |
if (!loggedIn()) { | |
replace({ | |
pathname: '/login' | |
}) | |
} |
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
BackAndroid.addEventListener("hardwareBackPress", () => { | |
if (navigator.getCurrentRoutes().length > 1) { | |
navigator.pop() | |
return true | |
} else { | |
return false | |
} | |
}) |
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
// actions/index.js imports all actions from its directory and exports them | |
import * as accountActions from "./accountActions" | |
import * as cartActions from "./cartActions" | |
export { | |
accountActions, | |
cartActions | |
} | |
// index.js imports the index.js files from each of these directories, |
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
/* | |
lib/ (es5 code) | |
actions/ | |
index.js | |
constants/ | |
index.js | |
reducers/ | |
index.js | |
utils/ |
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 addProduct(product) { | |
return (dispatch, getState) => { | |
const someOtherValue = getState().foo.bar | |
dispatch({ | |
type: ADD_PRODUCT, | |
data: product, | |
someOtherValue: someOtherValue | |
}) |
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 addProduct(product) { | |
return { | |
type: ADD_PRODUCT, | |
data: product | |
} | |
} |
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
{type: ADD_PRODUCT, data: product } |
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
var npm = require("npm"); | |
var fs = require("fs-extra"); | |
var chokidar = require("chokidar"); | |
var packagePaths = [ | |
"../mobile-app/node_modules/shared-package/lib", | |
"../web-app/node_modules/shared-package/lib", | |
]; | |
var noop = () => {}; |
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
/* | |
mobile-app/ | |
node_modules/ | |
shared-package/ | |
lib/ | |
native-app/ | |
node_modules/ | |
shared-package/ | |
lib/ |
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
mobile-app/ | |
node_modules/ | |
shared-package/ | |
lib/ | |
native-app/ | |
node_modules/ | |
shared-package/ | |
lib/ | |
shared-package/ | |
src/ (ES6 code we wrote) |
NewerOlder