From 410977189016b42516b84b8addd53699184baba3 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Tue, 1 Nov 2022 06:01:20 +0100 Subject: [PATCH] Filter should be builder pattern --- src/App.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.h b/src/App.h index 46d3912..751fd16 100644 --- a/src/App.h +++ b/src/App.h @@ -149,8 +149,10 @@ public: } /* Attaches a "filter" function to track socket connections/disconnections */ - void filter(MoveOnlyFunction *, int)> &&filterHandler) { + TemplatedApp &&filter(MoveOnlyFunction *, int)> &&filterHandler) { httpContext->filter(std::move(filterHandler)); + + return std::move(*this); } /* Publishes a message to all websocket contexts - conceptually as if publishing to the one single