We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f33eb8f commit 1352536Copy full SHA for 1352536
src/connect/junction-example.js
@@ -0,0 +1,25 @@
1
+"use strict";
2
+import Junction from "./junction";
3
+import assert from "power-assert";
4
+let junction = new Junction();
5
+junction.use(function toUpperCase(res, next) {
6
+ res.value = res.value.toUpperCase();
7
+ next();
8
+});
9
+junction.use(function exclamationMark(res, next) {
10
+ res.value = res.value + "!";
11
12
13
+junction.use(function (error, res, next) {
14
+ console.error(error.stack);
15
16
17
+
18
+let text = "hello world";
19
+junction.process(text, function (error, result) {
20
+ if (error) {
21
+ console.error(error);
22
+ }
23
+ let value = result.value;
24
+ assert.equal(value, "HELLO WORLD!");
25
0 commit comments