all files / src/imageLoader/internal/ options.js

66.67% Statements 2/3
100% Branches 0/0
50% Functions 1/2
66.67% Lines 2/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18                             25×    
let options = {
  // callback allowing customization of the xhr (e.g. adding custom auth headers, cors, etc)
  beforeSend (/* xhr, imageId */) {
  },
  // callback allowing modification of newly created image objects
  imageCreated (/* image */) {
  },
  strict: false
};
 
export function setOptions (newOptions) {
  options = newOptions;
}
 
export function getOptions () {
  return options;
}