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
//all func below this line are for deleting a bag | |
//this function will tell our react front end to wait, while we go and fetch a bag. You can use something like | |
//if (this.props.isFetching == true) {display a loading spinner} | |
//this action will display in Redux dev tools as 'BAG_DEL_REQ' with it's relevant information. | |
function deleteReqBag(id) { | |
return { | |
type: "BAG_DEL_REQ", |
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
//this function will return multiple functions (actions) to props. That's why it's named map dispatch to props. | |
//Dispatch is a way to say "go and do this thing for me" | |
// | |
//Using this code in react will allow us to say | |
//this.props.deleteBagDB(id), this.props.showItems(id), this.props.getBags() | |
// | |
//Remember: Import these action functions into your component first. | |
function mapDispatchToProps(dispatch) { |
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
this.setState(prevState => ({ | |
check: !prevState.check | |
})); |
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
addInventory (viewListID) { | |
console.log('hit'); | |
this.setState(prevState => ({ | |
viewListID: prevState.viewListID == viewListID ? null : viewListID | |
})); | |
} | |
{this.state.viewListID == bag.id && <BagList key={bag.id} id = {bag.id} description={bag.description} destination={bag.destination}/>} | |
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 Job from './Job' | |
export default class JobDetail extends React.Component { | |
constructor (props) { | |
super(props) | |
this.state = { | |
showJobId: null, | |
data: this.props.data |
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 obj = faves.reduce((acc, entry, i, arr) => { | |
if (!acc.hasOwnProperty(entry.id)) acc[entry.id] = entry | |
return acc | |
}, {}) | |
const noDupes = Object.keys(obj).map(key => obj[key]) |
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
*** directories *** | |
pwd - display path of current working directory. | |
cd - current directory | |
ls - list all files | |
cd .. - up a directory | |
mkdir - make new directory | |
*** | |
clear - clear window |
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
git revert --no-commit "entercommithashherewithout"""..HEAD |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>RESTful Routes</title> | |
<!-- <link rel="stylesheet" type="text/css" href="bootstrap.css"> --> | |
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Page title (goes in the tab on the browser)</title> | |
</head> | |
<body> | |
</body> |
NewerOlder