I hereby claim:
- I am aaronshaf on github.
- I am aaronshaf (https://keybase.io/aaronshaf) on keybase.
- I have a public key ASDOisGXmsm_9g4PRTg7t1pSwEiR-pQfznNpKGWE5zdtXwo
To claim this, I am signing this object:
| class ThingsFetcher extends React.Component { | |
| constructor (props) { | |
| super(props) | |
| this.state = { | |
| data: null, | |
| isLoading: false, | |
| wasLoadedSuccessfully: false, | |
| error: null | |
| } | |
| } |
| shouldComponentUpdate (nextProps, nextState) { | |
| const changedProps = {} | |
| for (const prop in this.props) { | |
| if (this.props[prop] !== nextProps[prop]) { | |
| changedProps[prop] = true | |
| } | |
| } | |
| if (Object.keys(changedProps).length) { | |
| console.debug(changedProps) |
| export default class TimeagoElement extends HTMLElement { | |
| connectedCallback() { | |
| if (this.querySelector('time')) { | |
| this.init() | |
| } else { | |
| window.requestAnimationFrame(() => { | |
| this.init() | |
| }) | |
| } | |
| } |
I hereby claim:
To claim this, I am signing this object:
| import React from 'react' | |
| import ReactDOM from 'react-dom' | |
| import { Editor, EditorState, RichUtils } from 'draft-js' | |
| import { stateToMarkdown } from 'draft-js-export-markdown' | |
| import { stateFromHTML } from 'draft-js-import-html' | |
| class MyEditor extends React.Component { | |
| constructor (props) { | |
| super(props) | |
| this.state = { |
| <my-element> | |
| <!-- | |
| provided content kept active (not inert) | |
| .screenreader-only added in Custom Element lifecycle | |
| --> | |
| <select class="screenreader-only"> | |
| <option></option> | |
| </select> | |
| <template class="intl-messages"> |
npm install create-element-class --save| const { docClient } = require('../services/dynamodb') | |
| exports.findAllItems = async function* () { | |
| let response = {} | |
| let ExclusiveStartKey | |
| do { | |
| response = await docClient.scan({ | |
| TableName: 'mytable', | |
| Limit: 500, | |
| ExclusiveStartKey |
| const Ajv = require('ajv') | |
| const ajv = Ajv() | |
| module.exports = function (schema) { | |
| const validate = ajv.compile(schema) | |
| return (req, res, next) => { | |
| const isValid = validate(res.body) | |
| if (!isValid) { | |
| console.log('invalid list response', validate.errors) | |
| res.status(500) |
| Array.from(new FormData(this.refs.form)).reduce((previousValue, currentValue) => { | |
| return Object.assign({}, previousValue, {[currentValue[0]]: currentValue[1]}) | |
| }, {}) |