Skip to content

Instantly share code, notes, and snippets.

⚛️

Bruno Lemos brunolemos

⚛️
Block or report user

Report or block brunolemos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brunolemos
brunolemos / debounce.js
Created Dec 20, 2016
React Debounce Render
View debounce.js
// usage:
// export default debounce(100)(MyComponent);
import React from 'react';
import debounce from 'lodash/debounce';
export default (interval, ...debounceArgs) => {
if (typeof interval !== 'number' && interval > 0) {
throw new Error('[debounce] Interval (ms) parameter not received.');
}
@brunolemos
brunolemos / ListView.js
Last active Nov 24, 2017
React Native - ListView receiving data as a prop <ListView data={[1,2,3]} />
View ListView.js
import React from 'react';
import { ListView } from 'react-native';
export default class extends React.PureComponent {
constructor(props) {
super(props);
const { data, dataSource, rowHasChanged: _rowHasChanged } = props;
this.state.data = data || [];
@brunolemos
brunolemos / destructuring.js
Last active Sep 14, 2016 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
View destructuring.js
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
You can’t perform that action at this time.