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 from 'react' | |
import { PersistedRecoilRoot } from './PersistedRecoilRoot' | |
const myState = atom({ key: '...', default: ... }) | |
const statesToPersist = [ | |
myState | |
] | |
export const App = () => { |
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
// we have a LOGOUT action that will reset the whole state | |
// HACK: When state is recreated, it will loose '_persist' in it, and the state will not be persisted anymore. | |
// Dispatching 'persist/REHYDRATE' makes persistence work again somehow, so we dispatch it to all persisted keys. | |
const storageKeys = yield call(storage.getAllKeys); | |
const persistKeys = (storageKeys.map((key: string) => { | |
const regexp = new RegExp('^persist:(.+)'); | |
if (key.match(regexp)) { | |
return RegExp.$1; | |
} |
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
/** | |
* Metro configuration for React Native | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
*/ | |
const { | |
getSymLinkedModules, | |
getBlacklistedModulesForAlternateRoot, | |
getExtraModulesForAlternateRoot, |
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
/** | |
* @flow | |
*/ | |
import React, { PureComponent } from 'react' | |
import { Text as NativeText, StyleSheet } from 'react-native' | |
import * as shared from 'cugn-vost-shared' | |
import { Theme } from '../../design' | |
import { createStyleSelector } from '../../services/style-helpers' | |
import type { c } from 'react' | |
import { i18n } from '../lang' |
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 {withAuthorization} from 'with-auth' | |
class MyProtectedComponent extends Component { | |
render () { | |
<View>...</View> | |
} | |
} | |
export default withAuthorization(MyProtectedComponent) |
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
/** | |
* @flow | |
*/ | |
import React, { Component } from 'react' | |
import { StyleSheet, Text } from 'react-native' | |
import { MyCustomText } from './MyCustomText' | |
export class App extends Component { | |
render () { | |
return ( |
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
/** | |
* @flow | |
*/ | |
import React from 'react' | |
import { AsyncStorage } from 'react-native' | |
import { connect } from 'react-redux' | |
import { RNDevToolbox } from 'rn-dev-toolbox' | |
import { isAuthenticated, getCurrentUser } from 'cugn-vost-shared/dist/flux/selectors' | |
import faker from 'faker' | |
import { store } from '../../redux/store' |
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 {setTransform, ReactNativeFile} from 'shared' | |
setTransform(file => new ReactNativeFile(file)) |
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 { combineReducers } from 'redux' | |
import reduceReducer from 'reduce-reducers' | |
const combineAndIsolateReducers = (reducers) => { | |
const keys = Object.keys(reducers) | |
const combined = combineReducers(reducers) | |
return (state = undefined, action) => { | |
// Important -> slice the needed state so it avoid combineReducers warnings | |
const sliced = {} |
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
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.js"></script> | |
<style type="text/css"> | |
</style> | |
<title>Angular: true one way binding</title> | |
</head> | |
<body> |
NewerOlder