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 { ApolloProvider } from '@apollo/react-hooks' | |
| import App from 'next/app' | |
| import React from 'react' | |
| import withApolloClient from './lib/with-apollo-client' | |
| class MyApp extends App { | |
| render () { | |
| const {Component, pageProps, apolloClient}: any = this.props | |
| return( | |
| <ApolloProvider client={apolloClient}> |
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
| // https://github.com/arnaudbenard/redux-mock-store/issues/59#issuecomment-345741265 | |
| //------------- the saga ---------------- | |
| function* fetchSaga(action) { | |
| try { | |
| yield put({type: "FETCH_SUCCEEDED", data: "data"}); | |
| } catch (e) { | |
| yield put({type: "FETCH_FAILED", message: e.message}); | |
| } | |
| } |
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
| for x in *.js; do mv "$x" "${x%.js}.jsx"; done |
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 axios from 'axios'; | |
| class Service { | |
| constructor() { | |
| let service = axios.create({ | |
| headers: {csrf: 'token'} | |
| }); | |
| service.interceptors.response.use(this.handleSuccess, this.handleError); | |
| this.service = service; | |
| } |
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 getPaginatedItems(items, page, pageSize) { | |
| var pg = page || 1, | |
| pgSize = pageSize || 100, | |
| offset = (pg - 1) * pgSize, | |
| pagedItems = _.drop(items, offset).slice(0, pgSize); | |
| return { | |
| page: pg, | |
| pageSize: pgSize, | |
| total: items.length, | |
| total_pages: Math.ceil(items.length / pgSize), |
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
| /** | |
| * Axios Request Wrapper | |
| * --------------------- | |
| * | |
| * @author Sheharyar Naseer (@sheharyarn) | |
| * @license MIT | |
| * | |
| */ | |
| import axios from 'axios' |
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
| var MY_CONSTANT = 42 | |
| // Implementation of a class | |
| var MyClass = function () { | |
| // constructor | |
| } | |
| MyClass.prototype.getAnswer = function () { | |
| return MY_CONSTANT | |
| } |
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
| color : | |
| interactive-color : | |
| background-color : | |
| text-color : | |
| font : | |
| family : | |
| size : | |
| line-height : | |
| border : | |
| size : |