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
import { combineReducers } from 'redux'; | |
import * as reducers from './index'; | |
const appReducer = combineReducers({ | |
...reducers, | |
}); | |
const rootReducer = (state, action) => { | |
if (action.type === 'ROOT_RESET') { | |
state = undefined; |
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
import { createStore, applyMiddleware } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import { persistStore, persistReducer } from 'redux-persist'; | |
import storage from 'redux-persist/lib/storage'; // defaults to AsyncStorage for react-native | |
import rootReducer from './reducers/root'; | |
const persistedReducer = persistReducer({ | |
key: 'root', | |
storage, |
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
startResetAnimation = () => { | |
this.resetAnimation = Animated.timing(this.state.screenOpacityAnim, { | |
toValue: 0, | |
duration: 500, | |
}); | |
this.resetAnimationFinished = false; | |
this.resetAnimation.start(({ finished }) => { | |
if (finished) { | |
this.resetAnimationFinished = true; | |
} |
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 unicodeForSymbol(code) { | |
var codeHex = code.toString(16).toUpperCase(); | |
while (codeHex.length < 4) { | |
codeHex = "0" + codeHex; | |
} | |
return "\\u" + codeHex; | |
} | |
console.log(unicodeForSymbol(58840)); // \uE5D8 |
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
export default function isPageLoggedIn() { | |
return Boolean(Array.from(document.body.querySelectorAll('a, button')).find(el => { | |
return el.innerText && el.innerText.match(/sign out|signout|log out|logout/i) !== null; | |
})); | |
} |