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 { useEffect, useRef } from 'react'; | |
| const useLogPropDiffs = (props, label = '') => { | |
| const previousProps = useRef({}); | |
| useEffect(() => { | |
| previousProps.current = props; | |
| }); | |
| if (previousProps.current) { |
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 processInbox() { | |
| // process all recent threads in the Inbox (see comment to this answer) | |
| var threads = GmailApp.search("newer_than:1d"); | |
| for (var i = 0; i < threads.length; i++) { | |
| // get all messages in a given thread | |
| var messages = threads[i].getMessages(); | |
| for (var j = 0; j < messages.length; j++) { | |
| var message = messages[j]; | |
| processMessage(message); | |
| } |
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 ResizeObserver from 'resize-observer-polyfill'; | |
| let resizeObserver; | |
| const subscriptions = {}; | |
| const onResizeCallback = elements => { | |
| elements.forEach(element => { | |
| const id = element.target.id; | |
| const callback = subscriptions[id] && subscriptions[id].callback; |
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
| .center-everything-in-div { | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| min-height: 100%; | |
| } |
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
| componentWillReceiveProps(nextProps) { | |
| for (const index in nextProps) { | |
| if (nextProps[index] !== this.props[index]) { | |
| console.log(index, this.props[index], '-->', nextProps[index]); | |
| } | |
| } | |
| } |
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 { bindActionCreators } from 'redux'; | |
| import { connect } from 'react-redux'; | |
| const mapStateToProps = (state) => ({}); | |
| export function withDispatch(WrappedComponent, actions) { | |
| class Dispatcher extends Component { | |
| render() { |