suren-atoyan / monaco-loader

The utility to easy setup monaco-editor into your browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why isInitialized is added back in 1.3.1

Aayush04 opened this issue · comments

Hi,
Wanted to understand the meaning of isInitialized flag in loader/index.js. As per my understanding you wanted it to not to initialized monaco again if already it was initialized.
But I guess that was get handled perfectly with check if(monaco) itself.
The reason why I am saying this. I have a use case if some how monaco-editor js didn't get loaded by this loader (could be any reason eg: js not present there) then I am calling loader.init() method again.
But because of isInitialized flag's value is already true. It never goes to load monaco-edtior js again. Which is a bug here.
After upgrading to 1.3.0 it was working perfectly fine. But this flag added back in 1.3.1.

If loader.init() failes then isInitialized should be marked as false.

@Aayush04 could you please check the latest version?