Skip to content

Commit

Permalink
add: util function to get global jsPsych instance
Browse files Browse the repository at this point in the history
  • Loading branch information
YUUU23 committed Aug 9, 2024
1 parent 03bb278 commit e3f4977
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,12 @@ export function getProlificId() {
export function interleave(arr, val, addBefore = true) {
return [].concat(...arr.map((n) => (addBefore ? [val, n] : [n, val])));
}

/**
* Get global JsPsych instance
*
* @returns JsPsych instance
*/
export function getJsPsych() {
return window.jsPsych;
}

0 comments on commit e3f4977

Please sign in to comment.