Skip to content

Commit

Permalink
Make examples more linter-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
trustmaster committed Jul 24, 2020
1 parent 6dc4b30 commit 0fb58d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/http/HelloController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const noflo = require("noflo");

exports.getComponent = function() {
exports.getComponent = () => {
const c = new noflo.Component;
c.description = "Simple controller that says hello, user";
c.inPorts.add('in',
Expand All @@ -9,7 +9,7 @@ exports.getComponent = function() {
{datatype: 'object'});
c.outPorts.add('data',
{datatype: 'object'});
c.process(function(input, output) {
c.process((input, output) => {
if (!input.hasData('in')) { return; }
const request = input.getData('in');
output.sendDone({
Expand Down
2 changes: 1 addition & 1 deletion examples/http/hello.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ graph.addInitial(`${__dirname}/hello.jade`, "Read Template", "in");
graph.addEdge("Read Template", "out", "Render", "template");
graph.addEdge("Render", "out", "Write Response", "string");

noflo.createNetwork(graph, function(err) {
noflo.createNetwork(graph, (err) => {
if (err) {
console.error(err);
process.exit(1);
Expand Down
10 changes: 4 additions & 6 deletions examples/linecount/count.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// TODO: This file was created by bulk-decaffeinate.
// Sanity-check the conversion and remove this comment.
// Flow-based example of counting lines of a file, roughly equivalent to
// "wc -l <filename>"

const noflo = require("noflo");

if (!process.argv[2]) {
console.error("You must provide a filename");
process.exit(1);
}
console.error("You must provide a filename");
process.exit(1);
}

const fileName = process.argv[2];

Expand All @@ -26,7 +24,7 @@ graph.addEdge("Count Lines", "count", "Display", "in");
// Kick the process off by sending filename to fileReader
graph.addInitial(fileName, "Read File", "in");

noflo.createNetwork(graph, function(err) {
noflo.createNetwork(graph, (err) => {
if (err) {
console.error(err);
process.exit(1);
Expand Down

0 comments on commit 0fb58d6

Please sign in to comment.