-
-
Save gokmen/5676246 to your computer and use it in GitHub Desktop.
React's secondsElapsed example with KDFramework
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
class Timer extends JView | |
constructor:-> | |
super cssClass: 'timer' | |
@setData secondsElapsed : 0 | |
viewAppended:-> | |
super | |
setInterval (@bound 'tick'), 1000 | |
tick:-> | |
@data.secondsElapsed += 1 | |
@render() | |
pistachio:-> | |
"Seconds elapsed: {{ #(secondsElapsed) }}" | |
appView.addSubView new Timer |
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
.timer { | |
background-color : #eee; | |
width : auto; | |
height : auto; | |
padding : 10px; | |
margin : 20px; | |
border : 1px solid #ccc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment