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
Use Wave / Toggl to bill | |
Include correct info | |
-date | |
-description of services | |
-payment terms (date, late fees, ect) | |
-GST / Reference number | |
-under 1000$ pay with credit card | |
Save Taxes |
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
SSR -> Server Side Rendering | |
SPA -> Single Page Application | |
#### SETUP Local Development Server ##### | |
use html boiler plate in ADP | |
-> npm i -g http-server | |
-> http-server | |
-->create-react-app [name of app] |
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
State | |
One-way data flow | |
Two-way data binding | |
Synthetic events | |
### Ref | |
For taking input from forms | |
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
npm i -g json-server | |
json-server --watch db.json -p 4000 | |
// "test": "echo \"Error: no test specified\" && exit 1", | |
// "start": "PORT=4001 nodemon index.js" | |
const items = fetch(' http://localhost:4000/items'); |
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, { Component } from 'react'; | |
import { render } from 'react-dom'; | |
import { | |
BrowserRouter as Router, | |
Route, | |
Switch, | |
Link, | |
Redirect | |
} from 'react-router-dom'; |
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
Procedural Programming | |
###### Pure function | |
- function that does not rely on data outside of its scope. Just does itself. No side effects. | |
- one output | |
- if it manipulates a global variable, it is impure (copy list into new variable, output that | |
- take an argument, make it newVariable, modify, output | |
{ robot.name = "Sean"} is a "reference" <- this will modify a global variable | |
{ robot = { name: "Sean" } } is "pass by value" <- this will not leave scope |
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
function toList(stockedList) | |
// Grocery store lab | |
const data = [ | |
['apples', 73], | |
['pears', 12], | |
['oranges', 97], | |
['grapes', 387], | |
['grapes', 88], |
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
const array = [ | |
[name: sean, | |
age: 35, | |
height: 6 | |
] | |
const CopyOfArray = { ...array }; | |
##### Spread is how we copy arrays |
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
TV = "state machine" | |
Remote control sends "actions" | |
-channel up / down | |
-power on ect | |
Webpack Installation | |
Install Webpack and its dependencies in your project: | |
npm install --save-dev babel-loader babel-core babel-preset-stage-0 webpack webpack-dev-server html-webpack-plugin | |
Add scripts to your package.json: |
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
REDUX GIVES YOU THE STORE, DISPATCH AND REDUCERS | |
### | |
store holds state | |
state is 0 | |
click the +1 button | |
'dispatches an action (which is action and state) to reducer | |
switch in reducer = if ActionType = type(increment) and payload (1), use the increment switch in the reducer to add 1 to state | |
state gets send back to store |