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 styled from 'styled-components'; | |
import Card from 'blocks/Card/card'; | |
function withElements(props) { | |
const modifiers = Object.keys(props).filter(propName => | |
propName.startsWith('_'), | |
) | |
return [props.className, ...modifiers].join(' ') | |
} |
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 { comp, into, map, filter } from 'transducers-js' | |
/* eslint-disable no-return-assign */ | |
// setReducer :: (a -> {a}) -> ({b} -> {a}) | |
// add reducers that are missing from the store | |
const setReducer = injectedReducers => ({key, reducer}) => injectedReducers[key] = reducer | |
/* eslint-enable */ | |
// hasReducer :: (a -> {a}) -> ({b} -> bool) | |
// returns a boolean based if the reducer to inject exists already or not |
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 PropTypes from 'prop-types' | |
import hoistNonReactStatics from 'hoist-non-react-statics' | |
import isEmpty from 'lodash/isEmpty' | |
import { createUpdatedReducer } from '../store' | |
import { setupNewReducers } from './reducer-injector-helper.utility' | |
const getDisplayName = ({displayName, name}) => `withReducer(${displayName || name || 'component'})` | |
export function injectReducerFactory (store) { |
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 Either = folktale.result; | |
const Maybe = folktale.maybe; | |
const {task} = folktale.concurrency; | |
const fetchResult = (value) => { | |
if (typeof value !== 'number'){ | |
throw 'not a number!' | |
} else { | |
return value | |
} |
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, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import Collapsable from './collaspable-hoc-styles'; | |
const getDisplayName = ({displayHelpScreen, name}) => displayHelpScreen || name || 'Component'; | |
export default function CollapsibleWrapper(defaultCollapseValue = true, displayToggle = true) { | |
return WrappedComponent => | |
class CollapsibleComponent extends PureComponent { |