Skip to content

Commit

Permalink
made Formio available globally
Browse files Browse the repository at this point in the history
  • Loading branch information
TanyaGashtold committed Jun 5, 2024
1 parent 0e94a83 commit 2d9a450
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Formio.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,18 @@ FormioCore.createForm = FormioEmbed.createForm;
FormioCore.submitDone = FormioEmbed.submitDone;
FormioCore.addLibrary = FormioEmbed.addLibrary;
FormioCore.addLoader = FormioEmbed.addLoader;
FormioCore.addToGlobal = (global) => {
if (typeof global === 'object' && !global.Formio) {
global.Formio = FormioCore;
}
};

if (typeof global !== 'undefined') {
FormioCore.addToGlobal(global);
}

if (typeof window !== 'undefined') {
FormioCore.addToGlobal(window);
}

export { FormioCore as Formio };

0 comments on commit 2d9a450

Please sign in to comment.