Skip to content

Commit bf81cf3

Browse files
committed
Remove atom from Dispatcher state
1 parent 7e760ac commit bf81cf3

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/Dispatcher.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Component, PropTypes } from 'react';
1+
import { PropTypes } from 'react';
22

33
function dispatch(store, atom, action) {
44
return store(atom, action);
55
}
66

7-
export default class Dispatcher extends Component {
7+
export default class Dispatcher {
88
static propTypes = {
99
store: PropTypes.func.isRequired,
1010
children: PropTypes.func.isRequired
@@ -18,9 +18,7 @@ export default class Dispatcher extends Component {
1818
return { redux: this };
1919
}
2020

21-
constructor(props, context) {
22-
super(props, context);
23-
21+
constructor(props) {
2422
this.subscriptions = [];
2523
this.emitChange = this.emitChange.bind(this);
2624
this.dispatch = this.dispatch.bind(this);
@@ -36,11 +34,6 @@ export default class Dispatcher extends Component {
3634

3735
setAtom(atom) {
3836
this.atom = atom;
39-
if (this.state) {
40-
this.setState({ atom });
41-
} else {
42-
this.state = { atom };
43-
}
4437
this.emitChange();
4538
}
4639

0 commit comments

Comments
 (0)