Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
installed react components MyDiv BtnA BtnB, Reflux Actions, and TheStore
- Loading branch information
EC2 Default User
committed
Aug 4, 2015
1 parent
b1a88b2
commit 31a6ca7
Showing
8 changed files
with
89 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//import Reflux from "bower_components/reflux/dist/reflux"; | ||
|
||
export default Reflux.createActions([ | ||
"swap" | ||
]); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//import React from "bower_components/react/react"; | ||
//import Reflux from "bower_components/reflux/dist/reflux"; | ||
import BtnA from "./components/BtnA" | ||
import BtnB from "./components/BtnB" | ||
import Actions from "./Actions" | ||
import TheStore from "./stores/TheStore" | ||
|
||
|
||
export default React.createClass({ | ||
//mixins: [Reflux.connect(TheStore)], | ||
render(){ | ||
return ( | ||
<div> This holds our buttons! <br /> | ||
<BtnA /> <BtnB /> | ||
</div> | ||
) | ||
} | ||
}) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Actions from "../Actions" | ||
import TheStore from "../stores/TheStore" | ||
|
||
export default React.createClass({ | ||
mixins: [Reflux.connect(TheStore)], | ||
getInitialState(){ | ||
return {"name":"btna"}; | ||
}, | ||
handleClick(){ | ||
console.log(this.state.name,"clicked",this.state.test); | ||
Actions.swap(this.state.test) | ||
}, | ||
render(){ | ||
return ( | ||
<button onClick={this.handleClick}> This is BtnA </button> | ||
) | ||
} | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Actions from "../Actions" | ||
import TheStore from "../stores/TheStore" | ||
|
||
export default React.createClass({ | ||
mixins: [Reflux.connect(TheStore)], | ||
getInitialState(){ | ||
return {"name":"btnb"}; | ||
}, | ||
handleClick(){ | ||
console.log(this.state.name,"clicked",this.state.test); | ||
Actions.swap(this.state.test) | ||
}, | ||
render(){ | ||
return ( | ||
<button onClick={this.handleClick}> This is BtnB </button> | ||
) | ||
} | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//import Reflux from "bower_components/reflux/dist/reflux"; | ||
import Actions from "../Actions"; | ||
|
||
export default Reflux.createStore({ | ||
listenables: Actions, | ||
|
||
init() { | ||
this.test = true; | ||
}, | ||
getInitialState(){ | ||
return this; | ||
}, | ||
onSwap(x){ | ||
console.log("switch triggered in: ",x) | ||
console.log("TheStore test is",this.test) | ||
this.trigger({test: !x}) | ||
} | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,3 @@ | ||
<div class="jumbotron"> | ||
<h2>Welcome to Phoenix!</h2> | ||
<p class="lead">Most web frameworks make you choose between speed and a productive environment. <a href="http://phoenixframework.org">Phoenix</a> and <a href="http://elixir-lang.org">Elixir</a> give you both.</p> | ||
</div> | ||
|
||
<div class="row marketing"> | ||
<div class="col-lg-6"> | ||
<h4>Resources</h4> | ||
<ul> | ||
<li> | ||
<a href="http://phoenixframework.org/docs/overview">Guides</a> | ||
</li> | ||
<li> | ||
<a href="http://hexdocs.pm/phoenix">Docs</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/phoenixframework/phoenix">Source</a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="col-lg-6"> | ||
<h4>Help</h4> | ||
<ul> | ||
<li> | ||
<a href="http://groups.google.com/group/phoenix-talk">Mailing list</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/phoenixframework/phoenix/issues?state=open">Issues</a> | ||
</li> | ||
<li> | ||
<a href="http://webchat.freenode.net/?channels=elixir-lang">#elixir-lang on freenode IRC</a> | ||
</li> | ||
<li> | ||
<a href="https://twitter.com/elixirphoenix">@elixirphoenix</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<div id="mydiv"> | ||
our crap should go here | ||
</div> |