Skip to content

Instantly share code, notes, and snippets.

View frankshaka's full-sized avatar

Frank Shaka frankshaka

View GitHub Profile
@frankshaka
frankshaka / index.js
Created May 13, 2019 10:46
Automerge for moving topics
const Automerge = require('automerge')
function printTopicTree(topic, indent = 2) {
let text = '* ' + topic.id
for (let i = 0; i < indent; i++) {
text = ' ' + text
}
console.log(text)
@frankshaka
frankshaka / index.js.diff
Last active September 11, 2017 05:07
Unmount paths even on error for koa-mount
58c58,68
< await downstream(ctx, async () => {
---
> try {
> await downstream(ctx, async () => {
> ctx.path = prev;
> try {
> await upstream();
> } finally {
> ctx.path = newPath;