Created
November 13, 2017 20:11
-
-
Save mraleph/63be907f18e1ca55991d69fed5608833 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Nothing { const Nothing(); } | |
class Pipeable { | |
var value = const Nothing(); | |
operator |(f) { | |
if (f == const Nothing()) { | |
return value; | |
} else if (value == const Nothing()) { | |
value = f(); | |
} else { | |
value = f(value); | |
} | |
return this; | |
} | |
} | |
pipeline() => new Pipeable(); | |
const done = const Nothing(); | |
final response = pipeline() | |
| loadConfig | |
| buildDic | |
| getApp | |
| getRouter | |
| (_) => getDispatcher(_, request) | |
| (_) => dispatchBusinessLogic(_, request, new Response()) | |
| renderResponse | |
| buildResponse | |
| emit | |
| done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment