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 { expect } from 'chai' | |
import supertest from 'supertest' | |
import server from '../../src/server' | |
describe('Test query', () => { | |
it('has correct getCharacters query', (done) => { | |
const request = supertest.agent(server) | |
const query = { | |
query: ` | |
query { |
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 loadState = () => { | |
try { | |
const serializedState = localStorage.getItem('store') | |
if (serializedState === null) { | |
return undefined | |
} else { | |
return JSON.parse(serializedState) | |
} | |
} catch (error) { | |
return undefined |
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 { createStore } from 'redux' | |
import rootReducer from '../reducers' | |
import { loadState, saveState } from '../lib/localStorage' | |
const persistStore = loadState() | |
const store = createStore(rootReducer, persistStore) | |
store.subscribe(() => { | |
saveState(store.getState()) | |
}) |
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 { createStore } from 'redux' | |
import { persistStore, persistReducer } from 'redux-persist' | |
import storage from 'redux-persist/lib/storage' | |
import rootReducer from '../reducers' | |
const persistConfig = { | |
key: 'root', | |
storage, | |
} |
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 ReactDOM from 'react-dom' | |
import { Provider } from 'react-redux' | |
import { PersistGate } from 'redux-persist/integration/react' | |
import App from './components/App' | |
import configureStore from './store' | |
const { store, persistor } = configureStore() | |
ReactDOM.render( |
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 persistConfig = { | |
key: 'root', | |
storage: storage, | |
blacklist: ['language'] // whitelist: ['language'] | |
}; |
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 { StyleSheet, Text, View, PanResponder } from 'react-native' | |
export default class App extends React.Component { | |
state = { | |
top: 0, | |
left: 0, | |
topTransition: 0, | |
leftTransition: 0, | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<div id="root"></div> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<div id="root"></div> |
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 { Form, Input } from 'antd' | |
class App extends Component { | |
handleSubmit = (e) => { | |
e.preventDefault() | |
this.props.form.validateFields((err, values) => { | |
if (!err) { | |
console.log('Received values of form: ', values) | |
} |