router: change order of arguments

fixup! freeze state & rename app ns to location
This commit is contained in:
Yoshua Wuyts
2016-07-02 22:54:35 +02:00
parent c679e37d3a
commit 6407188ee9
15 changed files with 85 additions and 50 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
const dateformat = require('dateformat')
const html = require('../../../html')
module.exports = function (params, state, send) {
module.exports = function (state, prev, send) {
const params = state.params
const mailbox = params.mailbox
const messages = state[mailbox].messages
return html`
+2 -1
View File
@@ -1,6 +1,7 @@
const html = require('../../../html')
module.exports = function (params, state, send) {
module.exports = function (state, prev, send) {
const params = state.params
const mailbox = params.mailbox
const message = params.message
+1 -1
View File
@@ -1,6 +1,6 @@
const html = require('../../../html')
module.exports = function (params, state, send) {
module.exports = function (state, prev, send) {
return html`
<section>
<p>Select a mailbox</p>
+2 -1
View File
@@ -2,7 +2,8 @@ const dateformat = require('dateformat')
const html = require('../../../html')
module.exports = function () {
return function (params, state, send) {
return function (state, prev, send) {
const params = state.params
const mailbox = params.mailbox
const message = params.message
const messages = state[mailbox].messages
+1 -1
View File
@@ -2,7 +2,7 @@ const html = require('../../../html')
const mailboxes = [ 'inbox', 'spam', 'sent' ]
module.exports = function (params, state, send) {
module.exports = function (state, prev, send) {
return html`
<aside class="fl mt4 w-20 db">
<ul>
+2 -2
View File
@@ -1,8 +1,8 @@
const pathname = require('pathname-match')
const html = require('../../../html')
module.exports = function (params, state, send) {
const location = state.app.location
module.exports = function (state, prev, send) {
const location = state.location.pathname
return html`
<span class="fl mt4 w-100 f4 b">
URL: ${pathname(location) || '/'}