molecule
molecule copied to clipboard
feat: multiple instances of Molecule
Description
The Molecule only supports the standalone currently, when you use the create() function, it just returns a global molecule instance. But some developers need to create multiple instances of Molecule in one page, like:
const moInstance1 = create({
extensions: [],
});
const moInstance2 = create({
extensions: [],
});
const App1 = () => moInstance.render(<Workbench />);
const App2 = () => moInstance2.render(<Workbench />);
// Do something
moInstance1.editor. open()
moInstance2.editor. open()