Skip to content

Instantly share code, notes, and snippets.

@jbracht
Created January 25, 2019 21:35
Show Gist options
  • Save jbracht/575ccf7572e1573e051029e540975f47 to your computer and use it in GitHub Desktop.
Save jbracht/575ccf7572e1573e051029e540975f47 to your computer and use it in GitHub Desktop.

ORM: Object Relational Mapper

  • backend
  • Ex: Sequelize!!!!
  • Allows us to talk to our DB
  • Tables = classes, rows = instances/objects

Middleware

  • backend
  • In web dev: runs between REQUEST & RESPONSE
  • Ex: morgan, express, body parser

Express

  • Backend
  • “API framework”
  • Library for route handling

API: Application Programming Interface

  • backend
  • “a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service.”
  • “An API is a software intermediary that allows two applications to talk to each other. In other words, an API is the messenger that delivers your request to the provider that you're requesting it from and then delivers the response back to you.”

React

  • Frontend
  • JS library for building UIs, based around reusable “components”
  • Virtual DOM: shadow copy of the real DOM, React’s playground to update and optimize update, so we do as little work as possible when we go to the real DOM

Components:

  • Building blocks of a React app
  • 2 types: Class (stateful) & functional/dumb (stateless)
    • Favor functional: simpler, no unnecessary overhead
  • Accepts properties (props)

Props:

  • “Creation parameters” passed from parent to child components
  • In different components:
    • Class: accessed via this.props
    • Functional: accessed via props parameter
  • How to pass: <Component name=’jess’ age=5 color=’red’ favoriteBunny=’eeyore’ /> ‘Component’ gets props:
props = {
   name: ‘jess’,
   age: 5,
   color: ‘red’,
   favoriteBunny: ‘eeyore’
}
  • Props are immutable - if I want to change it, need to pass NEW props

State:

  • Changeable!! (this.state is immutable, but we ‘change’ it using a method that will REPLACE the state)
  • Changes mean = re-render component
  • Always change via this.setState(...)
  • Only exists in class components, not functional

Node

  • backend
  • Allows us to write JS on an OS (outside the browser! wow!)
  • RUNTIME ENVIRONMENT
  • Other runtime environments: Chrome’s V8 engine

Promise

  • A thing you & ur bff do with your pinkies ???
  • A placeholder for an eventual value
  • Usually returned from ASYNC calls
  • 3 states: Pending, fulfilled, rejected
  • Handled with async/await, or .then()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment