Imagine we have a reducer to control a list of items:
function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
switch(action.type) {
case 'SHOW_ALL_ITEMS':
return action.data.items
default:| My Awesome Sketch | |
| First State | |
| some event -> Second State | |
| Second State |
| license: gpl-3.0 |
| license: gpl-3.0 |
| function shapeChart(categories) { | |
| var width = 200, | |
| height = 200; | |
| var outerRadius = 50; | |
| var ratingScale = 10; | |
| var angle = d3.scaleLinear() | |
| .range([0, 2 * Math.PI]); |
| function detailChart(categories) { | |
| var width = 800, | |
| height = 800; | |
| var outerRadius = 300; | |
| var ratingScale = 45; | |
| var references = []; |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| <div class="container"> | |
| <h1>HTML and CSS are awesome</h1> | |
| <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. At eum eius sequi dolor consectetur omnis quia | |
| necessitatibus beatae vero numquam.</p> | |
| </div> |
| .container { | |
| max-width: 800px; | |
| margin: 0 auto; | |
| font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; | |
| } | |
| h1 { | |
| text-transform: uppercase; | |
| background-color: orangered; | |
| color: white; | |
| } |
| .container { | |
| max-width: 800px; | |
| margin: 0 auto; | |
| font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; | |
| } | |
| h1 { | |
| text-transform: capitalize; | |
| color: orangered; | |
| } |