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 { combineReducers } from 'redux'; | |
| import users from './reducers/users'; | |
| import posts from './reducers/posts'; | |
| export default function createReducer(asyncReducers) { | |
| return combineReducers({ | |
| users, | |
| posts, | |
| ...asyncReducers | |
| }); |
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 ellipsis(str, charLimit) { | |
| var result = []; | |
| var letters = 0; | |
| str.split(' ').forEach(function(word, index) { | |
| if (letters < charLimit) {result.push(word)} | |
| letters += word.length; | |
| }); | |
| console.log(result.join(' ') + ' ...'); | |
| })("Hero congressman calls out conservatives on racist abortion restrictions", 40); |
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"> | |
| <title></title> | |
| <script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> | |
| <script> | |
| var googletag = googletag || {}; | |
| googletag.cmd = googletag.cmd || []; | |
| </script> |
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"> | |
| <title></title> | |
| <script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> | |
| <script> | |
| var googletag = googletag || {}; | |
| googletag.cmd = googletag.cmd || []; | |
| </script> |
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"> | |
| <title></title> | |
| <script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script> | |
| <script> | |
| var googletag = googletag || {}; | |
| googletag.cmd = googletag.cmd || []; | |
| </script> |
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 myarr = [1,2,[3]]; | |
| function flatten(arr) { | |
| if (Array.isArray(arr)) { | |
| return arr.reduce((prev, next) => { | |
| return prev.concat(flatten(next)); | |
| }, []); | |
| } else { | |
| return arr; | |
| } |
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 numberPairs(n, ar) { | |
| if (n !== ar.length) { | |
| console.error('Invalid array length'); | |
| } | |
| const obj = {}; | |
| const pairs = []; | |
| const pairsLength = 0; | |
| do { |
OlderNewer