Skip to content

Remove extra subscription

Compare
Choose a tag to compare
@acdlite acdlite released this 10 Jul 00:20
· 5 commits to master since this release

This release removes a hack we were using to set the initial state inside the constructor. Previously, we were creating an extra subscription and immediately disposing it as a way of "unwrapping" the initial value. Instead, now we have a check inside the observer which either calls setState() or assigns to this.state depending on whether the component has mounted.