Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multiple instances of Molecule #850

Open
wewoor opened this issue Mar 17, 2023 · 0 comments
Open

feat: multiple instances of Molecule #850

wewoor opened this issue Mar 17, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@wewoor
Copy link
Collaborator

wewoor commented Mar 17, 2023

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()
@wewoor wewoor added the enhancement New feature or request label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant