DTStack / DTStack/molecule

feat: multiple instances of Molecule

Open
#850 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
970
Forks
141
PR merge metrics
No merged PRs in 30d

Description

### 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:

```ts

const moInstance1 = create({
extensions: [],
});

const moInstance2 = create({
extensions: [],
});

const App1 = () => moInstance.render();

const App2 = () => moInstance2.render();

// Do something
moInstance1.editor. open()
moInstance2.editor. open()

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.