git ssb

2+

mixmix / ticktack



Commit 9836e9e9dcd5acec7ee3725da3b5e9784a5490bd

express routes in a style where adding a route only changes

a single line. This makes merges much less likely to conflict.

@mixmix previously, using destructuring `const {...} = api.app.pages`
means that line is changed by every merge, so two branches
adding routes cannot be merged without a conflict.
Dominic Tarr committed on 8/9/2017, 9:00:14 PM
Parent: dca0c3f17aa539ddd99053c9d36d42c371bc44b4

Files changed

router/sync/routes.jschanged
router/sync/routes.jsView
@@ -10,15 +10,15 @@
1010 })
1111
1212 exports.create = (api) => {
1313 return nest('router.sync.routes', (sofar = []) => {
14- const { home, group, channel, private: privatePage } = api.app.page
15-
14+ const pages = api.app.page
1615 // route format: [ routeValidator, routeFunction ]
1716 const routes = [
18- [ location => location.page === 'home', home ],
19- [ location => location.type === 'group', group ],
20- [ location => !isEmpty(location.key), privatePage ]
17+ [ location => location.page === 'home', pages.home ],
18+ [ location => location.type === 'group', pages.group ],
19+ [ location => location.page === 'channel', pages.channel ],
20+ [ location => !isEmpty(location.key), pages.privatePage ]
2121 ]
2222
2323 return [...routes, ...sofar]
2424 })
@@ -29,4 +29,6 @@
2929
3030
3131
3232
33+
34+

Built with git-ssb-web