aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2018-04-14 01:13:36 +0800
committerbitpshr <mail@bitpshr.net>2018-04-14 02:32:58 +0800
commit8974f933fc97a37f5cd8dcd510ff0e6dc21d6751 (patch)
tree83534cc83c316c10d9ed195f1c31bec869eaadf3 /app/scripts
parent4780f825b1bfb33f03c60133f293b122b8b43be4 (diff)
downloadtangerine-wallet-browser-8974f933fc97a37f5cd8dcd510ff0e6dc21d6751.tar
tangerine-wallet-browser-8974f933fc97a37f5cd8dcd510ff0e6dc21d6751.tar.gz
tangerine-wallet-browser-8974f933fc97a37f5cd8dcd510ff0e6dc21d6751.tar.bz2
tangerine-wallet-browser-8974f933fc97a37f5cd8dcd510ff0e6dc21d6751.tar.lz
tangerine-wallet-browser-8974f933fc97a37f5cd8dcd510ff0e6dc21d6751.tar.xz
tangerine-wallet-browser-8974f933fc97a37f5cd8dcd510ff0e6dc21d6751.tar.zst
tangerine-wallet-browser-8974f933fc97a37f5cd8dcd510ff0e6dc21d6751.zip
Add tests for ComposableObservableStore
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/lib/ComposableObservableStore.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/app/scripts/lib/ComposableObservableStore.js b/app/scripts/lib/ComposableObservableStore.js
index 688594b6d..d5ee708a1 100644
--- a/app/scripts/lib/ComposableObservableStore.js
+++ b/app/scripts/lib/ComposableObservableStore.js
@@ -11,24 +11,24 @@ class ComposableObservableStore extends ObservableStore {
* @param {Object} [initState] - The initial store state
* @param {Object} [config] - Map of internal state keys to child stores
*/
- constructor (initState, config) {
- super()
- this.updateStructure(config)
- }
+ constructor (initState, config) {
+ super(initState)
+ this.updateStructure(config)
+ }
/**
* Composes a new internal store subscription structure
*
* @param {Object} [config] - Map of internal state keys to child stores
*/
- updateStructure (config) {
+ updateStructure (config) {
this.config = config
- this.removeAllListeners()
- for (const key in config) {
- config[key].subscribe((state) => {
- this.updateState({ [key]: state })
- })
- }
+ this.removeAllListeners()
+ for (const key in config) {
+ config[key].subscribe((state) => {
+ this.updateState({ [key]: state })
+ })
+ }
}
/**