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 head(arr){ | |
| return arr.slice(0, 1); | |
| } | |
| function tail(arr){ | |
| return arr.slice(1); | |
| } |
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
| var React = require('react'); | |
| var shallowDiff = (a,b) => Object.keys(a).some(key => a[key] != b[key]); | |
| module.exports = class extends React.Component { | |
| shouldComponentUpdate (nextProps, nextState){ | |
| return shallowDiff(this.props, nextProps) || shallowDiff(this.state, nextState); | |
| } | |
| }; |
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
| var React = require('react'); | |
| module.exports = function(name){ | |
| return class extends React.Component{ | |
| render(){ | |
| return ( | |
| <span>Implement {name}</span> | |
| ) | |
| } | |
| } | |
| }; |
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
| module.exports = function(obj){ | |
| return Object.keys(obj).map(function(key){ | |
| return obj[key]; | |
| }); | |
| }; |
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
| var React = require('react/addons'); | |
| var ReactIgnore = { | |
| displayName: 'ReactIgnore', | |
| shouldComponentUpdate (){ | |
| return false; | |
| }, | |
| render (){ | |
| return React.Children.only(this.props.children); | |
| } |