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 OperatorFn<T> = (value: T) => T; | |
interface PipeFn { | |
<T>(...fns: OperatorFn<T>[]): (value: T) => T; | |
} | |
const pipe: PipeFn = (...fns) => value => | |
fns.reduce((val, fn) => fn(val), value); | |
export default pipe; |
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
// Utility components on top of styled-system. | |
// Inspired by [Rebass](https://rebassjs.org/) and adopted to our needs. | |
// See: https://react-typescript-cheatsheet.netlify.app/docs/advanced/patterns_by_usecase | |
import {Theme} from '@/styles/theme'; | |
import css, {SystemStyleObject} from '@styled-system/css'; | |
import shouldForwardProp from '@styled-system/should-forward-prop'; | |
import { | |
ComponentPropsWithRef, | |
ComponentPropsWithoutRef, |
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 { ApolloProvider } from '@apollo/react-hooks'; | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import ApolloClient from 'apollo-client'; | |
import { ApolloLink, Observable } from 'apollo-link'; | |
import React from 'react'; | |
const ErrorProvider = ({ errors, children }) => { | |
const errorLink = new ApolloLink( | |
() => | |
new Observable(observer => { |
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
$ yarn | |
$ yarn add -D typescript rollup rollup-plugin-typescript2 |
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
Show hidden characters
{ | |
"reactClassComponent": { | |
"prefix": "rcc", | |
"body": "import * as React from 'react'\n\nclass ${TM_FILENAME_BASE} extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React component class" | |
}, | |
"reactPureComponent": { | |
"prefix": "rpc", | |
"body": "import * as React from 'react'\n\nclass ${TM_FILENAME_BASE} extends React.PureComponent {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t</div>\n\t\t)\n\t}\n}\n\nexport default ${TM_FILENAME_BASE}\n", | |
"description": "Creates a React pure component class" |
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
{ | |
"diffEditor.renderSideBySide": false, | |
"editor.fontFamily": "Operator Mono Lig", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 14, | |
"editor.formatOnSave": 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
<?php | |
namespace ALehdet\AspaApi\GraphQL\Relay; | |
use Digia\GraphQL\Relay\PageInfo; | |
use Digia\GraphQL\Relay\PageInfoBuilderInterface; | |
abstract class AbstractPageBuilder implements PageInfoBuilderInterface | |
{ | |
/** |
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
class VehicleResolver extends AbstractResolver | |
{ | |
public function resolveFoo() | |
{ | |
return 'foo'; | |
} | |
public function resolveType($rootValue, $contextValues, $info) | |
{ | |
if ($rootValue instanceof Airplane) { |
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
yarn run v0.19.1 | |
$ flow; test $? -eq 0 -o $? -eq 2 | |
The flow server's version didn't match the client's, so it exited. | |
Going to launch a new one. | |
Launching Flow server for /Users/juuso/projects/poc | |
Spawned flow server (pid=15149) | |
Logs will go to /private/tmp/flow/zSUserszSjuusozSprojectszSpoc.log | |
src/hello/saga.js:13 | |
13: fork(function* () { |
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 isArray from 'lodash/isArray'; | |
import isFunction from 'lodash/isFunction'; | |
import isString from 'lodash/isString'; | |
import { takeLatest } from 'redux-saga'; | |
import { call, fork, put } from 'redux-saga/effects'; | |
import { arrayOf, Schema } from 'normalizr'; | |
import { callApi } from '../../api/helper'; | |
import { normalizeEntityResponse } from '../../common/helper'; | |
/** |