View source

class thx.Functions0

import thx.Functions;

Available on all platforms

Extension methods for functions with arity 0 (functions that do not take arguments).

Class Fields

static inline function after(callback:Void -> Void, n:Int):Void -> Void

Returns a function that invokes callback after being being invoked n times.

static inline function join(fa:Void -> Void, fb:Void -> Void):Void -> Void

join creates a function that calls the 2 functions passed as arguments in sequence.

static inline function negate(callback:Void -> Bool):Void -> Bool

Wraps callback in a function that negates its results.

static inline function once(f:Void -> Void):Void -> Void

once wraps and returns the argument function. once ensures that f will be called at most once even if the returned function is invoked multiple times.

static inline function times<T>(n:Int, callback:Void -> T):Void -> Array<T>

Creates a function that calls callback n times and returns an array of results.

static inline function timesi<T>(n:Int, callback:Int -> T):Void -> Array<T>

Creates a function that calls callback n times and returns an array of results.

Callback takes an additional argument index.

Toggle inherited fields