Skip to content

Instantly share code, notes, and snippets.

View Jahans3's full-sized avatar
:shipit:

Josh J Jahans3

:shipit:
View GitHub Profile
// @flow
import React, { createContext, PureComponent, Children, type Element, type Component } from 'react';
import { Animated, Keyboard } from 'react-native';
export type OptionsTypes = 'alert' | 'warning' | 'success'
export type Option = {
icon?: number,
text: string,
onPress: Function,
const webpack = require('webpack')
module.exports = config => Object.assign({}, {
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
// Component JS file
import React from 'react'
import s from './style.scss' // <--- Imported into JS file
const SomeComponent = () => (
<div className={s.container}> // <---- Can use more simple classes as they're automatically name-spaced
<span className={s.text}>Hello!</span>
</div>
)
// WithWrapper.js
const withWrapper = (Component, name) => ({ wrapper, ...props }) => {
if (wrapper) {
return (
<div className={`${name}_wrapper`}>
<Component {...props} />
</div>
)
}
<Alert bar success>Alert Bar</Alert>
<div class="alert_wrapper">
<div class="alert-bar-success">Alert Bar</div>
</div>
export type Action = {
type: string,
payload?: Object
}
import { Action } from '../types'
const signInRequest: Function = (): Action => ({
type: actionTypes.SIGN_IN_REQUEST
})
const signUpRequest: Function = (): { type: string } => ({
type: actionTypes.SIGN_UP_REQUEST
})
const signUpSuccess: Function = ({ data }: { data: Object }): { type: string, payload: { data: Object } } => ({
type: actionTypes.SIGN_UP_SUCCESS,
payload: { data }
})
const signUpFailure: Function = ({ error }: { error: Object }): { type: string, payload: { error: Object } } => ({
const H = require ( 'highland' );
const R = require ( 'ramda' );
const itemGenerator = require ( '../lib/itemGenerator.js' );
const itemStore = require ( '../lib/itemStore.js' );
const filterBySpotContext = require ( '../lib/filterBySpotContext.js' );
const config = require ( 'config' );
module.exports = R.curry ( ( utils, req, res ) => {
const annotationUris = R.reject ( R.isEmpty, ( req.query.annotation_uri || '' ).split ( '~' ) );
const confidence = parseFloat ( req.query.confidence || config.defaultConfidence );
import React from 'react'
import PropTypes from 'prop-types'
import styled from 'radium'
import SimpleHeader from '../../components/SimpleHeader'
import Image from '../../components/Image'
import HeaderFeature from '../../components/HeaderFeature'
import GridFeature from '../../components/GridFeature'
import MainFeature from '../../components/MainFeature'
import CTAFeature from '../../components/CTAFeature'
import FooterFeature from '../../components/FooterFeature'
const updateUsers = () => async dispatch => {
dispatch(fetchUsersBegin())
try {
const users = await userService.fetch()
dispatch(updateUsersSuccess(users))
catch (err) {
dispatch(updateUsersFailure(err))
}
}