-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Connect component supports to unsubscribe event by pass the call…
…back (#635) * feat: eventEmitter supports to unsubscribe event by pass the callback * test: unsubscribe the event by pass the callback * test: unsubscribe the event by pass the callback * fix: set the height 100% while in horizontal mode * fix: rename to uppercase * feat: add use case for react/connect function * test: new testService instance * refactor: rename callback to listener
- Loading branch information
Showing
11 changed files
with
118 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
|
||
&--horizontal { | ||
flex-direction: row; | ||
height: 100%; | ||
} | ||
|
||
&__item { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { IExtensionService } from 'mo/services'; | ||
import { IExtension } from 'mo/model'; | ||
import molecule from 'mo'; | ||
|
||
import { Pane } from './pane'; | ||
|
||
export const ExtendPanel: IExtension = { | ||
id: 'ExtendsProblems', | ||
name: 'Extends Problems', | ||
activate(extensionCtx: IExtensionService) { | ||
molecule.panel.add({ | ||
id: 'TestPanel', | ||
name: 'Test Panel', | ||
renderPane: () => <Pane />, | ||
}); | ||
}, | ||
dispose() { | ||
molecule.problems.remove(1); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import molecule from 'mo'; | ||
import { IEditor } from 'mo/model'; | ||
import { connect } from 'mo/react'; | ||
import React from 'react'; | ||
|
||
export const Pane = connect(molecule.editor, function ({ current }: IEditor) { | ||
const value: string = current?.tab?.data?.value || '!!!'; | ||
return <div style={{ padding: 20 }}>Editor Input: {value}</div>; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters