mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
now .images itself is iterable...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
dfa9693c58
commit
5ed2c02032
@ -433,7 +433,8 @@ module.ImagesPrototype = {
|
|||||||
res = func.call(this[key], res, this[key], key, i++, this) }
|
res = func.call(this[key], res, this[key], key, i++, this) }
|
||||||
return res },
|
return res },
|
||||||
|
|
||||||
iter: function*(){
|
// make images iterable...
|
||||||
|
[Symbol.iterator]: function*(){
|
||||||
for(var key in this){
|
for(var key in this){
|
||||||
// reject non images...
|
// reject non images...
|
||||||
// XXX make this cleaner...
|
// XXX make this cleaner...
|
||||||
@ -442,6 +443,9 @@ module.ImagesPrototype = {
|
|||||||
|| this[key] instanceof Function){
|
|| this[key] instanceof Function){
|
||||||
continue }
|
continue }
|
||||||
yield [key, this[key]] } },
|
yield [key, this[key]] } },
|
||||||
|
iter: function*(){
|
||||||
|
for(e of this){
|
||||||
|
yield e } },
|
||||||
|
|
||||||
// XXX remove version...
|
// XXX remove version...
|
||||||
keys: function(){
|
keys: function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user