suren-atoyan / monaco-loader

The utility to easy setup monaco-editor into your browser
MIT License
177 stars 37 forks source link

Why isInitialized is added back in 1.3.1 #19

Closed Aayush04 closed 1 year ago

Aayush04 commented 2 years ago

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.

suren-atoyan commented 2 years ago

@Aayush04 could you please check the latest version?