Skip to content

Instantly share code, notes, and snippets.

View martynaskadisa's full-sized avatar

Martynas Kadiša martynaskadisa

View GitHub Profile
@martynaskadisa
martynaskadisa / ConnectedComponent.tsx
Last active December 18, 2017 15:26
Differentiation between app states
import * as React from 'react';
import { connect } from 'react-redux';
import AppType from 'apps/appType';
import AppState from 'apps/state';
interface Props {
name: string;
}
const Component: React.SFC<Props> = ({ name }) => <div>{name}</div>;
@martynaskadisa
martynaskadisa / index.tsx
Created November 21, 2017 13:31
Composing components
import Component from './Component';
import { connect } from 'react-redux';
import { compose } from 'redux';
import hidable from 'hof/hidable';
import awesomeHof from 'hof/awesome';
export default compose(
connect<StateProps, DispatchProps, {}>(mapStateToProps, mapDispatchToProps),
awesomeHof,
hidable