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 { | |
BUTTON_DOWN, | |
singlePressAction, | |
} from './actions' | |
const handleButtonPress = buttonState => ( | |
buttonState === BUTTON_DOWN | |
&& singlePressAction() | |
) |
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
curry = func => (...args) => ( | |
args.length >= func.length | |
? func(...args) | |
: (...moreArgs) => curry(func)(...args.concat(moreArgs)) | |
) |
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
uncurry = func => (...args) => { | |
const numberOfFunctionArgs = func.length || args.length | |
const value = func(...args.slice(0, numberOfFunctionArgs)) | |
return ( | |
typeof value === 'function' | |
? uncurry(value)(...args.slice(numberOfFunctionArgs)) | |
: value | |
) | |
} |
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 React from 'react' | |
import { ReduxConnection } from '@ghadyani-framework/redux-components' | |
const textSelector = ( | |
({ text }) => ( | |
text, | |
) | |
) | |
const TestComponent = ({ |
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 React from 'react' | |
import { ReduxConnection } from '@ghadyani-framework/redux-components' | |
import { authInfoSelector } from '~/redux/auth/selectors' | |
const IsAuthenticated = ({ | |
children, | |
}) => ( | |
<ReduxConnection selector={authInfoSelector}> | |
{({ |
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 React from 'react' | |
import { connect } from 'react-redux' | |
import { authInfoSelector } from '~/redux/auth/selectors' | |
export const IsAuthenticated = ({ | |
children, | |
hasReceivedAuthInfo, | |
isAuthenticated, | |
}) => ({ |
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 PropTypes from 'prop-types' | |
import React from 'react' | |
import { ReduxConnection } from '@ghadyani-framework/redux-components' | |
import { authInfoSelector } from '~/redux/auth/selectors' | |
const propTypes = { | |
children: PropTypes.node.isRequired, | |
} |
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 CheckCircleIcon from '@material-ui/icons/CheckCircle' | |
import CircleIcon from '@material-ui/icons/Circle' | |
import List from '@material-ui/core/List' | |
import ListItem from '@material-ui/core/ListItem' | |
import ListItemIcon from '@material-ui/core/ListItemIcon' | |
import ListItemText from '@material-ui/core/ListItemText' | |
import PropTypes from 'prop-types' | |
import React, { Fragment } from 'react' | |
import { MaterialUiStyles } from 'imagined-material-ui-styles-component' | |
import { push } from 'connected-react-router' |
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 List from '@material-ui/core/List' | |
import PropTypes from 'prop-types' | |
import React, { Fragment } from 'react' | |
import { MaterialUiStyles } from 'imagined-material-ui-styles-component' | |
import { ReduxConnection } from '@ghadyani-framework/redux-components' | |
import CheckboxListItems from '~/components/lists/CheckboxListItems' | |
import SectionHeading from '~/components/siteLayout/SectionHeading' | |
import { listItemsSelector } from '~/redux/lists/selectors' | |
import { sectionHeadingSelector } from '~/redux/sections/selectors' |
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
<ReduxConnection | |
namespace={namespace} | |
selector={listItemsSelector} | |
> | |
{({ listItems }) => ( | |
listItems | |
.map(({ | |
id, | |
isChecked, | |
name, |