mirror of
https://github.com/psychopy/psychojs.git
synced 2025-05-12 08:38:10 +00:00
data/TrialHandler: add next method, trialIterator getter
This commit is contained in:
parent
284542c114
commit
91f5c86adc
@ -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.
|
* Iterator over the trial sequence.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user