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 myState = { | |
| almafa: 'B' | |
| }; | |
| const Foo = (props) => ( | |
| <div>Hello { props.belmafa }</div> | |
| ); | |
| function myReducer(state = myState, action) { | |
| switch (action.type) { |
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
| // Good | |
| const Calendar = (props) => ( | |
| <div className="calendar" onClick={ props.handleClick }> | |
| { props.title } | |
| </div> | |
| ); | |
| // Good |
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
| str.replace(/\s/g, ''); |
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
| *, | |
| *:before, | |
| *:after{ | |
| box-sizing: border-box; | |
| } |
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
| ///////////////// | |
| // Semantic.gs // for LESS: http://lesscss.org/ | |
| ///////////////// | |
| // Defaults which you can freely override | |
| @column-width: 60; | |
| @gutter-width: 20; | |
| @columns: 12; | |
| // Utility variable — you should never need to modify this |
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
| url.replace(/^.*?:\/\//, '') |
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>Document</title> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
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 { jsdom } from 'jsdom'; | |
| const document = jsdom('<html><body><div id="root"></div></body></html>'); | |
| const window = document.defaultView; | |
| global.document = document; | |
| global.window = window; | |
| global.navigator = window.navigator; |
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 competitors = require('./competitors.json'); | |
| if (!Array.isArray(competitors)) { | |
| console.log('Hiba: az átadott elem típusának tömbnek kell lennie.'); | |
| } | |
| competitors | |
| .sort(function (a, b) { | |
| return b.points - a.points; | |
| }) |
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 test from 'ava'; | |
| import * as actionTypes from './your-action-types'; | |
| import reducer from './your-reducer'; | |
| import deepEqual from 'deep-equal'; | |
| test('reducer:immutability test', t => { | |
| const dummy = {}; | |
| for (const action in actionTypes) { | |
| if (actionTypes.hasOwnProperty(action)) { | |
| const result = reducer(dummy, {type: actionTypes[action]}); |