1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-11 16:18:10 +00:00

data/TrialHandler: add next method, trialIterator getter

This commit is contained in:
Sotiri Bakagiannis 2021-05-19 17:18:47 +01:00
parent 284542c114
commit 91f5c86adc

View File

@ -122,6 +122,21 @@ export class TrialHandler extends PsychObject
}
get trialIterator() {
return this[Symbol.iterator]();
}
/**
* Helps go through each trial in the sequence one by one, mirrors PsychoPy.
*/
next() {
const { value } = this.trialIterator.next();
return value;
}
/**
* Iterator over the trial sequence.
*