forked from richardszalay/raix
-
Notifications
You must be signed in to change notification settings - Fork 0
toEnumerable
richardszalay edited this page May 20, 2011
·
1 revision
Convience method for creating IEnumerable
sequences
global function toEnumerable(... args) : IObservable.<*>
toObservable
can be considered to have the following overloads:
Signature | Equivalent |
function toEnumerable() |
Enumerable.empty() |
function toEnumerable(enumerable : IEnumerable) |
enumerable |
function toEnumerable(array : Array) |
Enumerable.fromArray(array) |
function toEnumerable(proxy : Proxy) |
Enumerable.fromProxy(proxy) |
function toEnumerable(value : *) |
Enumerable.value(value) |
for each(var value : int in toEnumerable(5))
{
trace(value);
}
// Trace output is:
// 5
for each(var value : int in toEnumerable([1, 2, 3, 4, 5]))
{
trace(value);
}
// Trace output is:
// 1
// 2
// 3
// 4
// 5