(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import { EditorState, Modifier, Entity, SelectionState } from 'draft-js' | |
| import linkifyIt from 'linkify-it' | |
| import tlds from 'tlds' | |
| const linkify = linkifyIt() | |
| linkify.tlds(tlds) | |
| const linkifyEditorState = (editorState) => { | |
| const contentState = editorState.getCurrentContent() |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Return the "pivot index" of the given array of numbers. The pivot index is | |
| // the index where the sum of the numbers on the left is equal to the sum of | |
| // the numbers on the right. | |
| function pivot(numbers) { | |
| validateInput(numbers); | |
| // Find a pivot index by testing each index | |
| for (var i = 0; i < numbers.length; i++) { | |
| var leftSum = sum(numbers.slice(0, i)); | |
| var rightSum = sum(numbers.slice(i + 1)); |