This file contains 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 t0 = performance.now() | |
// slowest | |
const results = list.filter((item) => { | |
return matchObjPropsToValue(item, searchTerm, props, fullTextSearch) | |
}) | |
Alternative method using currying an ramda. | |
// fast | |
import { matchObjPropsToValue, mapWhile } from '../helpers/match-helpers' |
This file contains 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 style from './UserDropDown.scss' | |
class UserDropDown extends React.Component { | |
render() { | |
const { logout, user } = this.props | |
return ( | |
<div> | |
<span onClick={logout}>{user.username}</span> |
This file contains 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
/* eslint-disable */ | |
import React from 'react'; | |
import ScrollBehavior from './scroll-behavior'; | |
class ScrollBehaviorContainer extends React.Component { | |
static propTypes = { | |
shouldUpdateScroll: React.PropTypes.func, | |
routerProps: React.PropTypes.object.isRequired, | |
children: React.PropTypes.node.isRequired, | |
elTarget: React.PropTypes.string |
This file contains 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 cloudinaryCore from 'cloudinary-core' | |
const cloudinary = cloudinaryCore.Cloudinary.new() | |
cloudinary.config({ cloud_name: 'macvad' }) | |
// ** OPTIONS ** | |
// height (int), width (int), crop (string - fit/scale/pad/++ - requried for resize) | |
// Lots more | |
// http://cloudinary.com/documentation/image_transformations#sample_image |
There is an on going issue with using non-css module css in projects.
This causes issues with people needing to change webpack config, or mainters need to create a css-module specific version. We should not be forcing people to go through a bunch of configuration to get css modules and standard css to play nicely together.
I suggest a few ways to solve this problem long term, and I think the change should come from CSS Modules as it is non-standard.
- Change extension All CSS Modules have the file extension .cssm (or module.css). Then any loaders would know these are CSS modules, and other imports are standard css.
This file contains 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 someFunctionThatIsAsync(callback) { | |
/// Do something that happens asyncronously. That is, not in the order that is it called. | |
var data = fs.readFile('data.json') | |
// In this example it will execute doSomethingWithData(data) | |
callback(data) | |
} | |
function doSomethingWithData(data) { | |
document.querySelector('#data').innerText = data |
This file contains 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
// Get data from https://jsonplaceholder.typicode.com/posts | |
const examplePostsData = [ | |
{ | |
"userId": 1, | |
"id": 1, | |
"title": "Some crazy title", | |
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto" | |
}, | |
{ |
This file contains 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
// This code is untested. It may new some minor modifications to work | |
import RelayQueryResponseCache from "relay-runtime/lib/RelayQueryResponseCache"; | |
import { | |
Environment, | |
Network, | |
RecordSource, | |
Store, | |
Observable |
OlderNewer