Class: CommonIterator

CommonIterator

CommonIterator allows a chaincode to check whether any more result(s) need to be fetched from an iterator and close it when done.

new CommonIterator(handler, channel_id, txID, response)

constructor
Parameters:
Name Type Description
handler ChaincodeSupportClient client handler
channel_id string channel id
txID string transaction id
response object decoded payload

Methods


<async> close()

close the iterator.
Returns:
A promise that is resolved with the close payload or rejected if there is a problem
Type
promise

<async> next()

Get the next value and return it through a promise and also emit it if event listeners have been registered.
Returns:
a promise that is fulfilled with the next value. If there is no more next value, "done" key of the object is true. It is rejected if any error occurs.
Type
promise