From 82c697b08e50be7a15a4eb9401f38130e15e265d Mon Sep 17 00:00:00 2001 From: rxi Date: Thu, 3 Apr 2014 20:09:56 +0100 Subject: [PATCH] Added lume.combine() to README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index d3f81a9..27182a9 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,16 @@ f() -- Prints "Hello" f() -- Does nothing ``` +### lume.combine(...) +Creates a wrapper function which calls each supplied argument in the order they +were passed to `lume.combine`. The wrapper function passes its own arguments to +each of its wrapped functions when it is called. +```lua +local f = lume.combine(function(a, b) print(a + b) end, + function(a, b) print(a * b) end) +f(3, 4) -- Prints "7" then "12" on a new line +``` + ### lume.time(fn, ...) Inserts the arguments into function `fn` and calls it. Returns the time in seconds the function `fn` took to execute followed by `fn`'s returned values.