diff --git a/src/data/TrialHandler.js b/src/data/TrialHandler.js index 4cba062..fedf407 100644 --- a/src/data/TrialHandler.js +++ b/src/data/TrialHandler.js @@ -122,6 +122,17 @@ export class TrialHandler extends PsychObject } + /** + * Helps go through each trial in the sequence one by one, mirrors PsychoPy. + */ + next() { + const trialIterator = this[Symbol.iterator](); + const { value } = trialIterator.next(); + + return value; + } + + /** * Iterator over the trial sequence. *