From 849d6d3597c1d7b4c53f6f1e27b2ce4078054d5b Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 24 Sep 2018 14:58:49 -0400 Subject: [PATCH] eliminate another partial special case --- app/components/ecosystem.js | 29 +---------------------------- app/views/redirect.js | 9 ++------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/app/components/ecosystem.js b/app/components/ecosystem.js index 3b83a2f..3dd2b52 100644 --- a/app/components/ecosystem.js +++ b/app/components/ecosystem.js @@ -1,11 +1,5 @@ "use strict"; - - -// P A C K A G E - -import Component from "choo/component"; - // V A R I A B L E S const APPLICATIONS = require("./ecosystem/module-applications"); @@ -16,13 +10,7 @@ const LIGHTHOUSE = require("./ecosystem/submodule-lighthouse"); const REFLECTOR = require("./ecosystem/submodule-reflector"); const WALLET = require("./ecosystem/submodule-wallet"); - - -// P R O G R A M - -Ecosystem.prototype = Object.create(Component.prototype); - -Ecosystem.prototype.createElement = () => { +export default function () { return `
`; }; - - - -// E X P O R T - -module.exports = exports = Ecosystem; - - - -// H E L P E R S - -function Ecosystem() { - if (!(this instanceof Ecosystem)) return new Ecosystem(); - Component.call(this); -} diff --git a/app/views/redirect.js b/app/views/redirect.js index 598dc57..4244f13 100644 --- a/app/views/redirect.js +++ b/app/views/redirect.js @@ -145,13 +145,8 @@ function partialFinder(markdownBody) { if (fileExistsTest) { const partialFunction = require(path.join(__dirname, "..", `./components/${filename}.js`)); - - if (filename === "ecosystem") { - const neatPartial = new partialFunction; - markdownBody = markdownBody.replace(partial, neatPartial.render()); - } - - else if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction); + + if (filename === "glossary-toc") markdownBody = markdownBody.replace(partial, partialFunction); else markdownBody = markdownBody.replace(partial, partialFunction.default()); }