These rules are adopted from the AngularJS commit conventions.
| (ns kata.core-test | |
| (:require [clojure.test :refer :all])) | |
| ;; Langton's Ant - http://en.wikipedia.org/wiki/Langton's_ant | |
| ;; | |
| ;; At a white square, turn 90° right, flip the color of the square, move forward one unit | |
| ;; At a black square, turn 90° left, flip the color of the square, move forward one unit | |
| (def flip | |
| {:black :white |
Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
| Driver: | |
| -Write the code according to the navigator's specification | |
| -Listen intently to the navigators instructions | |
| -Ask questions wherever there is a lack of clarity | |
| -Offer alternative solutions if you disagree with the navigator | |
| -Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on | |
| -Make sure code is clean | |
| -Own the computer / keyboard | |
| -Ignore larger issues and focus on the task at hand | |
| -Trust the navigator - ultimately the navigator has the final say in what is written |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
React makes compositing components easy. However testing them can get ugly if you are not careful. Consider this example:
var ChildA = React.createClass({
displayName: "ChildA",
render: function(){
return (<div>A in the house</div>);
}
});| import Kefir from 'kefir'; | |
| import {List, Stack} from 'immutable'; | |
| import {comp, filter, map} from 'transducers-js'; | |
| function register(stream, messageType, handler) { | |
| let xform = comp( | |
| filter(x => x.first() === messageType), | |
| map(x => x.rest())); | |
| stream.transduce(xform).onValue(handler); | |
| } |
| /* | |
| Simple serial "one by one" sync/async promises based validation. | |
| */ | |
| import validator from 'validator' | |
| import Promise from 'bluebird' | |
| export function focusInvalidField(reactComponent) { | |
| return (error) => { | |
| if (error instanceof ValidationError) { | |
| if (!error.prop) return |
Read the DOCS.
This is easy and straightforward. All you need is to add react-transmit into dependencies (npm install --save react-transmit). Transmit works as a Higher-order component so instead of
export default class Dashboard extends PureComponent {
// ...| /** | |
| * Basic proof of concept. | |
| * - Hot reloadable | |
| * - Stateless stores | |
| * - Stores and action creators interoperable with Redux. | |
| */ | |
| import React, { Component } from 'react'; | |
| export default function dispatch(store, atom, action) { |