Last active
August 17, 2016 21:04
Revisions
-
outhouse revised this gist
Aug 17, 2016 . No changes.There are no files selected for viewing
-
outhouse revised this gist
Aug 17, 2016 . 2 changed files with 2 additions and 2 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const app = choo() const pages = [ { title : 'Bear', content : 'I\'m a bear', media : 'http://placebear.com/600/400' , slug : '/' }, { title : 'Kitten', content : 'Meow', media : 'http://placekitten.com/600/400' , slug : '/kitten' } ] app.model({ 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 charactersOriginal file line number Diff line number Diff line change @@ -4393,7 +4393,7 @@ const app = choo() const pages = [ { title : 'Bear', content : 'I\'m a bear', media : 'http://placebear.com/600/400' , slug : '/' }, { title : 'Kitten', content : 'Meow', media : 'http://placekitten.com/600/400' , slug : '/kitten' } ] app.model({ -
outhouse revised this gist
Aug 17, 2016 . 2 changed files with 2 additions and 2 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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const html = require('choo/html') const app = choo() const pages = [ { title : 'Bear', content : 'I\'m a bear', media : 'http://placebear.com/600/400' , slug : '/' }, { title : 'Kitten', content : 'Meow', media : 'http://placekitten.com/600/400' , slug : 'kitten' } ] 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 charactersOriginal file line number Diff line number Diff line change @@ -4392,7 +4392,7 @@ const html = require('choo/html') const app = choo() const pages = [ { title : 'Bear', content : 'I\'m a bear', media : 'http://placebear.com/600/400' , slug : '/' }, { title : 'Kitten', content : 'Meow', media : 'http://placekitten.com/600/400' , slug : 'kitten' } ] -
outhouse revised this gist
Aug 17, 2016 . 2 changed files with 4 additions and 8 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 charactersOriginal file line number Diff line number Diff line change @@ -34,10 +34,8 @@ const mainView = (state, prev, send) => html` </main> </div> ` app.router(route => pages.map(page => route(page.slug, mainView))) const tree = app.start() document.body.appendChild(tree) 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 charactersOriginal file line number Diff line number Diff line change @@ -4423,10 +4423,8 @@ const mainView = (state, prev, send) => html` </main> </div> ` app.router(route => pages.map(page => route(page.slug, mainView))) const tree = app.start() document.body.appendChild(tree) -
outhouse revised this gist
Aug 17, 2016 . 2 changed files with 8 additions and 8 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 charactersOriginal file line number Diff line number Diff line change @@ -34,10 +34,10 @@ const mainView = (state, prev, send) => html` </main> </div> ` const routes = pages.map(function(page){ return route(page.slug,mainView) }) app.router((route) => routes ) const tree = app.start() document.body.appendChild(tree) 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 charactersOriginal file line number Diff line number Diff line change @@ -4423,10 +4423,10 @@ const mainView = (state, prev, send) => html` </main> </div> ` const routes = pages.map(function(page){ return route(page.slug,mainView) }) app.router((route) => routes ) const tree = app.start() document.body.appendChild(tree) -
outhouse revised this gist
Aug 17, 2016 . 2 changed files with 2 additions and 2 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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ app.model({ const menu = (state, prev, send) => html` <nav> <ul> ${pages.map((page) => html`<li><a href="${page.slug}" onclick=${(e) => send('updatePage', page)}>${page.title}</button></li>`)} </ul> </nav> ` 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 charactersOriginal file line number Diff line number Diff line change @@ -4408,7 +4408,7 @@ app.model({ const menu = (state, prev, send) => html` <nav> <ul> ${pages.map((page) => html`<li><a href="${page.slug}" onclick=${(e) => send('updatePage', page)}>${page.title}</button></li>`)} </ul> </nav> ` -
outhouse revised this gist
Aug 17, 2016 . 2 changed files with 2799 additions and 2779 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 charactersOriginal file line number Diff line number Diff line change @@ -2,28 +2,38 @@ const choo = require('choo') const html = require('choo/html') const app = choo() const pages = [ { title : 'Bear', content : 'I\'m a bear', media : 'http://placebear.com/600/400' , slug : 'bear' }, { title : 'Kitten', content : 'Meow', media : 'http://placekitten.com/600/400' , slug : 'kitten' } ] app.model({ state: { currentPage: pages[0] }, reducers: { updatePage: (data, state) => ({ currentPage: data }) } }) const menu = (state, prev, send) => html` <nav> <ul> ${pages.map((page,index,array) => html`<li><button onclick=${(e) => send('updatePage', page)}>${page.title}</button></li>`)} </ul> </nav> ` const mainView = (state, prev, send) => html` <div> ${menu(state, prev, send)} <main> <h1>${state.currentPage.title}</h1> <img src="${state.currentPage.media}"/> <div>${state.currentPage.content}</div> </main> </div> ` app.router((route) => [ route('/', mainView) -
outhouse created this gist
Aug 17, 2016 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ const choo = require('choo') const html = require('choo/html') const app = choo() const pages = [ { title : 'Content 1', content : 'This is some content for page 1', media : 'https://placeholdit.imgix.net/~text?txtsize=33&txt=Image%201&w=350&h=150', slug : 'page-1' }, { title : 'Content 2', content : 'This is content for page 2', media : 'https://placeholdit.imgix.net/~text?txtsize=33&txt=Image%201&w=350&h=150' , slug : 'page-2' } ] app.model({ state: { currentPage: pages[0] } }) const mainView = (state, prev, send) => html` <div> <ul> ${pages.map((page) => html`<li>${page.title}</li>`)} </ul> <main> <h1>${state.currentPage.title}</h1> <div>${state.currentPage.content}</div> </main> </div> ` app.router((route) => [ route('/', mainView) ]) const tree = app.start() document.body.appendChild(tree) 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ { "name": "requirebin-sketch", "version": "1.0.0", "dependencies": { "choo": "3.2.0" } } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <!-- contents of this file will be placed inside the <body> --> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <!-- contents of this file will be placed inside the <head> --> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ made with [requirebin](http://requirebin.com)