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
export default class MessageContainer extends React.Component { | |
// ... | |
renderFooter() { | |
if (this.props.renderFooter) { | |
const footerProps = { | |
...this.props, | |
}; | |
return this.props.renderFooter(footerProps); | |
} | |
return null; |
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
renderLoadEarlier(loadEarlierProps) { | |
return <MyLoadEarlier | |
text={loadEarlierProps.content} | |
/> | |
} | |
render() { | |
return <MessageContainer {...props} renderHeader={this.renderHeader}> | |
} |
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
// ... | |
render() { | |
return <MessageContainer | |
{...props} | |
renderLoadEarlier={() => null} | |
/> | |
} |
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
export default class Card extends Component { | |
constructor(props) { | |
super(props); | |
} | |
renderHeader(headerProps) { | |
if (!this.props.renderHeader) { | |
return this.props.renderHeader(headerProps) | |
} |
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
{ | |
"data": { | |
"result": null, | |
"type": "object", | |
"parent": "/api/users", | |
"options": {} | |
}, | |
"error": { | |
"type": "not found", | |
"message": "no users found", |
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
_, err := TrollIEUsers() | |
if err != nil { | |
handleError(w, err) | |
return | |
} |
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
type APIResponse struct { | |
Data interface{} `json:”data”` | |
Error string `json:”error”` | |
Status int `json:”status”` | |
} |
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 to deep copy an object | |
function deepCopy(object) { | |
return JSON.parse(JSON.stringify(object)); | |
} |
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
Simple Multi-View Routing with Page.js and Vue.js |