zazuko / clownface

Simple but powerful graph traversing library for RDF
https://zazuko.github.io/clownface/
37 stars 8 forks source link

Return this on forEach() #30

Closed l00mi closed 4 years ago

l00mi commented 4 years ago

For each should return the clownface object instance from which it was invoked.

https://github.com/rdf-ext/clownface/blob/master/lib/Clownface.js#L95

tpluscode commented 4 years ago

Could you be more specific?

l00mi commented 4 years ago

The idea is to be able to chain the result given to forEach() to other CF methods.

E.g. cf.out(rdfs.type).forEach(x => {console.log(x)}).out(rdfs.label).forEach(z = {console.log(z.value)}).