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
// component | |
type AnotherType = { | |
data: { | |
id: string | |
} | |
} | |
type Props = { | |
aFunction: ({ id: string }) => AnotherType | |
} |
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
// @flow | |
import * as React from 'react'; | |
import compose from 'recompose/compose'; | |
import getThreadById from './queries' | |
import type { GetThreadType } from './queries'; | |
type Props = { | |
data: { | |
thread: GetThreadType, | |
... |
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
// @flow | |
import * as React from 'react'; | |
type Props = { | |
... | |
} | |
class Foo extends React.Component<Props> { | |
render() { | |
return ( |
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
// FILE ONE | |
type Return = { | |
content: { | |
body?: string, | |
title: string, | |
} | |
} | |
const getThread = (id: string): Return => { | |
// database.get() returns a promise |
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 React, { Component } from 'react' | |
import compose from 'recompose/compose' | |
import { gql, graphql } from 'react-apollo' | |
import List from './List' | |
class Images extends Component { | |
render () { | |
const { loading, error, allGalleries } = this.props.allImages | |
if (allGalleries && allGalleries.length > 0) { |
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
/* | |
On Spectrum we store permissions within communities in a table called `usersCommunities`. | |
This table returns records that look like: | |
{ | |
id: ID | |
userId: ID | |
communityId: ID | |
isMember: Boolean | |
isModerator: Boolean | |
isOwner: Boolean |
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 React, { Component } from 'react' | |
export default class Test extends Component { | |
// if you're using flow or any sort of type checker, you can declar proptypes up here | |
state: { | |
value: string | |
} | |
// "The constructor method is a special method for creating and initializing an object created with a class." - MDN | |
constructor() { |
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
const returnTooltip = props => { | |
switch (props.tipLocation) { | |
case 'top-left': | |
return ` | |
&:after { | |
bottom: calc(100% + 5px); | |
right: 0; | |
} | |
&:before { | |
right: calc(50% - 5px); |
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 { gql } from 'react-apollo'; | |
import { userFragments } from './user' | |
export const frequencyFragments = { | |
frequencySubscribers: gql` | |
fragment frequencySubscribers on Frequency { | |
subscriberConnection { | |
pageInfo { | |
hasNextPage | |
hasPreviousPage |
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
var app = require('../app'); | |
var express = require('express'); | |
var router = express.Router(); | |
var mongoose = require('mongoose'); | |
var async = require('async'); | |
var jwt = require('jsonwebtoken'); | |
var User = require("../models/user.js"); | |
/*------------------------------------------------------------\* | |
* |
NewerOlder