Skip to content

Instantly share code, notes, and snippets.

View becca-bailey's full-sized avatar

Becca Bailey becca-bailey

View GitHub Profile
@becca-bailey
becca-bailey / externalaccount-create.json
Created August 2, 2017 20:13
Sample external account create request
POST /externalaccount/create
{
"customerId": 298991,
"routingNumber": 123456789,
"accountNumber": 123456789,
"firstName": "John",
"lastName": "Smith",
"type": "Checking"
}
@becca-bailey
becca-bailey / externalaccount-initiate-response.json
Created August 2, 2017 20:33
Response from /externalaccount/initiate
{
"data": {
"accountNumberMasked": "*************6789",
"customerId": 298991,
"customField1": "",
"customField2": "",
"customField3": "",
"customField4": "",
"customField5": "",
"externalAccountId": 299101,
@becca-bailey
becca-bailey / apprenticeship-reading-list.md
Last active September 8, 2017 15:20
Apprenticeship Reading List

Apprenticeship Reading List

CSS / Animation

  • Designing Interface Animation by Val Head (Rosenfeld)
  • Animation at Work by Rachel Nabors (A Book Apart Briefs)

Accessibility

  • Accessibility for Everyone by Laura Kalbag (A Book Apart)
  • A Web for Everyone: Designing Accessible User Experiences by Sarah Horton & Whitney Quesenbery (Rosenfeld)
@becca-bailey
becca-bailey / redux-notes.md
Created October 3, 2017 03:46
Zagaku notes for 6/3/17

Redux Patterns

State

Typically, each component has a state.

class ListItem extends Component {
  constructor() {
    this.state = {

Styleguides to JavaScript

Popular Styleguides

What is a styleguide?

  • Source of truth for CSS + HTML components
class ParentClass extends React.Component {
state = {
alert: undefined
};
render() {
return (
<SimpleComponentWithAlert renderAlert={this.renderAlert} showAlert={this.showAlert} />
)
}
class SimpleComponentWithAlert extends React.Component {
state = {
alert: undefined
};
render() {
const { alert } = this.state;
const myAlert = {
message: "This is my alert",
type: "error"
it("shows an alert", () => {
const wrapper = mount(<SimpleComponentWithAlert />);
wrapper.find('button').simulate('click');
expect(wrapper.text()).toContain("This is my alert"));
});
class AlertManager extends React.Component {
state = {
alert: undefined
};
render() {
const { alert } = this.state;
const { children } = this.props;
return children({ alert, showAlert: this.showAlert });
}
class SimpleComponentWithAlert extends React.Component {
render() {
const myAlert = { message: "This is my alert", type: "error" };
return (
<AlertManager>
{({ alert, showAlert }) => (
<div>
{alert && <FancyAlertMessage alert={alert} />}
<button onClick={() => showAlert(myAlert)}>Show Alert</button>
</div>