Last active
January 3, 2018 18:15
-
-
Save StoneCypher/96e2c147694bddb91c98 to your computer and use it in GitHub Desktop.
Revisions
-
StoneCypher revised this gist
Jan 3, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import {Spinner} from './brainless_renderer.js'; // this is a vanilla js app. it knows nothing of react, other than // to call `.render` on line 9 with relevant data and callbacks. var App = function() { -
StoneCypher revised this gist
Oct 18, 2017 . 2 changed files with 14 additions and 14 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ // this is the react app. it knows nothing of the vanilla app, other than that the information // will come in in props, and that it should call this hook when this button is pressed, or etc var Spinner = (props) => <div> {this.props.data} <button value="↑" onclick={this.props.hooks.inc}/> <button value="↓" onclick={this.props.hooks.dec}/> </div>; export {Spinner}; 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ import {Spinner} from './brainless_renderer.js'; // this is a vanilla js app. it knows nothing of react, other than // to call `.render` on line 7 with relevant data and callbacks. @@ -18,17 +20,3 @@ var App = function() { repaint }; } -
StoneCypher revised this gist
Oct 1, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,6 @@ var App = function() { var Spinner = (props) => <div> {this.props.data} <button value="↑" onclick={this.props.hooks.inc}/> <button value="↓" onclick={this.props.hooks.dec}/> </div>; -
StoneCypher revised this gist
Oct 1, 2017 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ // this is a vanilla js app. it knows nothing of react, other than // to call `.render` on line 7 with relevant data and callbacks. var App = function() { var repaint = () => ReactDOM.render(document.body, <Spinner data={counter} hooks={hooks}/>), @@ -18,6 +21,11 @@ var App = function() { // this is the react app. it knows nothing of the vanilla app, other than that the information // will come in in props, and that it should call this hook when this button is pressed, or etc var Spinner = (props) => <div> {this.props.data} -
StoneCypher revised this gist
Oct 1, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ var App = function() { hooks = {inc, dec}; return { value: () => counter, inc, dec, repaint -
StoneCypher revised this gist
Oct 1, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,9 @@ var App = function() { hooks = {inc, dec}; return { value: () => counter, inc, dec, repaint }; } -
StoneCypher revised this gist
Sep 27, 2017 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ var App = function() { var repaint = () => ReactDOM.render(document.body, <Spinner data={counter} hooks={hooks}/>), counter = 0, inc = () => { ++counter; repaint() }, dec = () => { --counter; repaint() }, @@ -11,7 +12,7 @@ var App = function() { inc: inc, dec: dec, value: () => counter, repaint }; } -
StoneCypher revised this gist
Sep 27, 2017 . 1 changed file with 6 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -17,16 +17,9 @@ var App = function() { var Spinner = (props) => <div> {this.props.data} <button value="^" onclick={this.props.hooks.inc}/> <button value="v" onclick={this.props.hooks.dec}/> </div>; -
StoneCypher revised this gist
Sep 27, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var App = function() { inc = () => { ++counter; repaint() }, dec = () => { --counter; repaint() }, hooks = {inc, dec}; return { inc: inc, -
StoneCypher revised this gist
Aug 16, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,13 +11,13 @@ var App = function() { inc: inc, dec: dec, value: () => counter, repaint: () => ReactDOM.render(document.body, <Spinner data={counter} hooks={hooks}/>) }; } var Spinner = (props) => ({ render: function() { -
StoneCypher revised this gist
Feb 17, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -23,8 +23,8 @@ var Spinner = React.createClass({ return <div> {this.props.data} <button value="^" onclick={this.props.hooks.inc}/> <button value="v" onclick={this.props.hooks.dec}/> </div>; } -
StoneCypher created this gist
Feb 17, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ var App = function() { var counter = 0, inc = () => { ++counter; repaint() }, dec = () => { --counter; repaint() }, hooks = {inc: inc, dec: dec}; return { inc: inc, dec: dec, value: () => counter, repaint: () => React.render(document.body, <Spinner data={counter} hooks={hooks}/>) }; } var Spinner = React.createClass({ render: function() { return <div> {this.props.data} <button value="^" onclick={this.props.inc}/> <button value="v" onclick={this.props.dec}/> </div>; } });