From 23560bfa33e05938f7063b77a3c3887d93a71539 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Sun, 20 Jan 2019 02:13:20 +0000 Subject: [PATCH] Add handler so closures can implement state renderable via the wrapper --- src/AST/Handler.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/AST/Handler.php diff --git a/src/AST/Handler.php b/src/AST/Handler.php new file mode 100644 index 0000000..034e1dd --- /dev/null +++ b/src/AST/Handler.php @@ -0,0 +1,32 @@ +closure = $closure; + } + + /** + * @param State $State + * @return T&Renderable + */ + public function renderable(State $State) + { + return ($this->closure)($State); + } +}