This Gist was automatically created by Carbide, a free online programming environment.
[You can view a live, interactive version of this Gist here](http://alpha.trycarbide.com/@mcanas/5551cda70140709cffe8f
import React from 'react'; | |
export class StateDispatcher extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = props.state || {}; | |
this._dispatch = this.dispatch.bind(this); | |
} | |
dispatch(action) { |
This Gist was automatically created by Carbide, a free online programming environment.
[You can view a live, interactive version of this Gist here](http://alpha.trycarbide.com/@mcanas/5551cda70140709cffe8f
$base-line-size: 1.5rem; | |
$base-line-color: rgba(0,0,0,.35); | |
$base-line-alt-color: rgba(0,0,0,.15); | |
html { | |
font-size: 100%; | |
line-height: 1.5rem; | |
} | |
body.base-line-grid { |
[63] pry(#<Post>):2> self | |
=> #<Post:0x007fa9487c9860 | |
id: 1, | |
title: "First Post", | |
body: "This is the first post in our system", | |
created_at: Tue, 25 Aug 2015 21:04:37 UTC +00:00, | |
updated_at: Tue, 25 Aug 2015 21:04:37 UTC +00:00> | |
[64] pry(#<Post>):2> self.title | |
=> "First Post" | |
[65] pry(#<Post>):2> self.title = 'First post title changed' |
This gist assumes:
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.fss__screen { | |
background: #eee; | |
overflow: hidden; |
<table> | |
<thead> | |
<tr> | |
<th id="id">id</th> | |
<th id="firstName">first name</th> | |
<th id="lastName">last name</th> | |
<th id="dateOfBirth">date of birth</th> | |
<th id="email">email</th> | |
<th id="phone">phone</th> | |
<th id="password">password</th> |
/**********************/ | |
// CODE: | |
/**********************/ | |
function myTestableCode() { | |
return true; | |
} | |
/**********************/ | |
// TESTS: |
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging | |
/** | |
* A modified (improved?) version of the jQuery plugin design pattern | |
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details. | |
* | |
* ADVANTAGES OF EITHER FRAMEWORK: | |
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace | |
* - Ensures ability to use '$' even in compat modes | |
* |
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging | |
/** | |
* A modified (improved?) version of the jQuery plugin design pattern | |
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details. | |
* | |
* ADVANTAGES OF EITHER FRAMEWORK: | |
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace | |
* - Ensures ability to use '$' even in compat modes | |
* |