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 characters
| [ | |
| 3, | |
| 2, | |
| 14, | |
| 18, | |
| 36, | |
| 15, | |
| 29, | |
| 39, | |
| 36, |
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 characters
| [ | |
| 10, | |
| 24, | |
| 74, | |
| 136, | |
| 310, | |
| 160, | |
| 283, | |
| 630, | |
| 698, |
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 characters
| .messages | |
| .message( | |
| repeat<user> = @userMessages | |
| class<active> = @activeUser.id == user.id | |
| click = :activate user | |
| ) | |
| .name {user.message} | |
| .latest {.text (tail user.messages)} | |
| .date {friendly message.timestamp} | |
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 characters
| import List | |
| Task : { done: Boolean, id: Int, name: String } | |
| Tasks : { name: String, tasks: List Task } | |
| TasksList : List Tasks | |
| Component "tasks-page" { | |
| attrs: {tasks: Tasks} | |
| state: {newTask: ""} |
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 characters
| tweets = Socket "api.localhost.dev/tweets" | |
| >> filter (.favorites > 1000) | |
| >> sortBy .favorites | |
| >> take 10 | |
| App { | |
| state: { tweets } | |
| template: | |
| h1 Favorite Tweets | |
| .tweet( |
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 characters
| # Front end | |
| api = connectAPI "https://localhost:3000" | |
| Colors = api.collection 'colors' | |
| colors = Colors | |
| << sortBy .name | |
| App { |
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 characters
| Flint = require('Flint') | |
| api = Flint.api | |
| colors = api.collection 'colors', { | |
| add: (item) -> | |
| remove: (id) -> | |
| change: (id, newItem) -> | |
| } |
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 characters
| App { | |
| state = { left = 50, name = "nick" }, | |
| template = | |
| h1(left: @left) hello man | |
| button(click: @left -= 50) go left | |
| button(click: @left += 50) go right | |
| h1() my name is {@name} | |
| input(sync: @name) |
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 characters
| App { | |
| state: { activeMessage: 0 } | |
| routes: { | |
| message: { | |
| route: "/messages/{id}" | |
| action: :loadMessage | |
| } | |
| } | |
| actions: |
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 characters
| placeholder = "What needs to be done?" | |
| type Filter = All | Active | Complete | |
| filterFn = case Filter of | |
| All: constant True | |
| Complete: (eq .complete) | |
| Active: (not << eq) .complete | |
| App { |