Skip to content
Snippets Groups Projects
Commit 5fed5593 authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: tweaks

parent 1a2d2a84
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,8 @@ export class Plugin extends React.Component<{ plugin: PluginContext }, { }> { ...@@ -32,7 +32,8 @@ export class Plugin extends React.Component<{ plugin: PluginContext }, { }> {
} }
export class _test_CurrentObject extends React.Component<{ plugin: PluginContext }, { }> { export class _test_CurrentObject extends React.Component<{ plugin: PluginContext }, { }> {
componentWillMount() { componentDidMount() {
// TODO: move to constructor?
this.props.plugin.behaviors.state.data.currentObject.subscribe(() => this.forceUpdate()); this.props.plugin.behaviors.state.data.currentObject.subscribe(() => this.forceUpdate());
} }
render() { render() {
......
...@@ -11,7 +11,8 @@ import { StateObject } from 'mol-state' ...@@ -11,7 +11,8 @@ import { StateObject } from 'mol-state'
import { PluginCommands } from 'mol-plugin/command'; import { PluginCommands } from 'mol-plugin/command';
export class StateTree extends React.Component<{ plugin: PluginContext }, { }> { export class StateTree extends React.Component<{ plugin: PluginContext }, { }> {
componentWillMount() { componentDidMount() {
// TODO: move to constructor?
this.props.plugin.events.state.data.updated.subscribe(() => this.forceUpdate()); this.props.plugin.events.state.data.updated.subscribe(() => this.forceUpdate());
} }
render() { render() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment