@@ -127,7 +127,7 @@ return /******/ (function(modules) { // webpackBootstrap
127
127
// arg instanceof Immutable.Sequence is unreleable
128
128
return ( isImmutable ( arg ) )
129
129
? arg . toJS ( )
130
- : arg ;
130
+ : arg
131
131
}
132
132
133
133
/**
@@ -166,7 +166,7 @@ return /******/ (function(modules) { // webpackBootstrap
166
166
167
167
/**
168
168
* In Nuclear Reactors are where state is stored. Reactors
169
- * contain a " state" object which is an Immutable.Map
169
+ * contain a ' state' object which is an Immutable.Map
170
170
*
171
171
* The only way Reactors can change state is by reacting to
172
172
* messages. To update staet, Reactor's dispatch messages to
@@ -265,7 +265,7 @@ return /******/ (function(modules) { // webpackBootstrap
265
265
var newState = store . handle ( currState , actionType , payload )
266
266
267
267
if ( debug && newState === undefined ) {
268
- var error = " Store handler must return a value, did you forget a return statement"
268
+ var error = ' Store handler must return a value, did you forget a return statement'
269
269
logging . dispatchError ( error )
270
270
throw new Error ( error )
271
271
}
@@ -294,7 +294,9 @@ return /******/ (function(modules) { // webpackBootstrap
294
294
* @param {Store } store
295
295
*/
296
296
Reactor . prototype . registerStore = function ( id , store ) { "use strict" ;
297
+ /* eslint-disable no-console */
297
298
console . warn ( 'Deprecation warning: `registerStore` will no longer be supported in 1.1, use `registerStores` instead' )
299
+ /* eslint-enable no-console */
298
300
var stores = { }
299
301
stores [ id ] = store
300
302
this . registerStores ( stores )
@@ -306,13 +308,15 @@ return /******/ (function(modules) { // webpackBootstrap
306
308
Reactor . prototype . registerStores = function ( stores ) { "use strict" ;
307
309
each ( stores , function ( store , id ) {
308
310
if ( this . __stores . get ( id ) ) {
309
- console . warn ( "Store already defined for id=" + id )
311
+ /* eslint-disable no-console */
312
+ console . warn ( 'Store already defined for id = ' + id )
313
+ /* eslint-enable no-console */
310
314
}
311
315
312
316
var initialState = store . getInitialState ( )
313
317
314
318
if ( this . debug && ! isImmutableValue ( initialState ) ) {
315
- throw new Error ( " Store getInitialState() must return an immutable value, did you forget to call toImmutable" )
319
+ throw new Error ( ' Store getInitialState() must return an immutable value, did you forget to call toImmutable' )
316
320
}
317
321
318
322
this . __stores = this . __stores . set ( id , store )
@@ -334,10 +338,10 @@ return /******/ (function(modules) { // webpackBootstrap
334
338
var storeState = prevState . get ( id )
335
339
var resetStoreState = store . handleReset ( storeState )
336
340
if ( debug && resetStoreState === undefined ) {
337
- throw new Error ( " Store handleReset() must return a value, did you forget a return statement" )
341
+ throw new Error ( ' Store handleReset() must return a value, did you forget a return statement' )
338
342
}
339
343
if ( debug && ! isImmutableValue ( resetStoreState ) ) {
340
- throw new Error ( " Store reset state must be an immutable value, did you forget to call toImmutable" )
344
+ throw new Error ( ' Store reset state must be an immutable value, did you forget to call toImmutable' )
341
345
}
342
346
state . set ( id , resetStoreState )
343
347
} )
@@ -462,7 +466,6 @@ return /******/ (function(modules) { // webpackBootstrap
462
466
/* 5 */
463
467
/***/ function ( module , exports , __webpack_require__ ) {
464
468
465
- var Immutable = __webpack_require__ ( 7 )
466
469
var isFunction = __webpack_require__ ( 8 ) . isFunction
467
470
var isArray = __webpack_require__ ( 8 ) . isArray
468
471
var isKeyPath = __webpack_require__ ( 4 ) . isKeyPath
@@ -507,7 +510,7 @@ return /******/ (function(modules) { // webpackBootstrap
507
510
*/
508
511
function fromKeyPath ( keyPath ) {
509
512
if ( ! isKeyPath ( keyPath ) ) {
510
- throw new Error ( " Cannot create Getter from KeyPath: " + keyPath )
513
+ throw new Error ( ' Cannot create Getter from KeyPath: ' + keyPath )
511
514
}
512
515
513
516
return [ keyPath , identity ]
@@ -541,8 +544,8 @@ return /******/ (function(modules) { // webpackBootstrap
541
544
component . __unwatchFns = [ ]
542
545
each ( this . getDataBindings ( ) , function ( getter , key ) {
543
546
var unwatchFn = reactor . observe ( getter , function ( val ) {
544
- var newState = { } ;
545
- newState [ key ] = val ;
547
+ var newState = { }
548
+ newState [ key ] = val
546
549
component . setState ( newState )
547
550
} )
548
551
@@ -554,7 +557,7 @@ return /******/ (function(modules) { // webpackBootstrap
554
557
while ( this . __unwatchFns . length ) {
555
558
this . __unwatchFns . shift ( ) ( )
556
559
}
557
- }
560
+ } ,
558
561
}
559
562
}
560
563
@@ -564,9 +567,9 @@ return /******/ (function(modules) { // webpackBootstrap
564
567
*/
565
568
function getState ( reactor , data ) {
566
569
var state = { }
567
- for ( var key in data ) {
568
- state [ key ] = reactor . evaluate ( data [ key ] )
569
- }
570
+ each ( data , function ( value , key ) {
571
+ state [ key ] = reactor . evaluate ( value )
572
+ } )
570
573
return state
571
574
}
572
575
@@ -4493,22 +4496,13 @@ return /******/ (function(modules) { // webpackBootstrap
4493
4496
/* 8 */
4494
4497
/***/ function ( module , exports , __webpack_require__ ) {
4495
4498
4496
- /**
4497
- * Checks if the passed in value is a number
4498
- * @param {* } val
4499
- * @return {boolean }
4500
- */
4501
- exports . isNumber = function ( val ) {
4502
- return typeof val == 'number' || objectToString ( val ) === '[object Number]'
4503
- }
4504
-
4505
4499
/**
4506
4500
* Checks if the passed in value is a string
4507
4501
* @param {* } val
4508
4502
* @return {boolean }
4509
4503
*/
4510
4504
exports . isString = function ( val ) {
4511
- return typeof val == 'string' || objectToString ( val ) === '[object String]'
4505
+ return typeof val === 'string' || objectToString ( val ) === '[object String]'
4512
4506
}
4513
4507
4514
4508
/**
@@ -4522,14 +4516,14 @@ return /******/ (function(modules) { // webpackBootstrap
4522
4516
4523
4517
// taken from underscore source to account for browser descrepency
4524
4518
/* istanbul ignore if */
4525
- if ( typeof / ./ != 'function' && typeof Int8Array != 'object' ) {
4519
+ if ( typeof / ./ !== 'function' && typeof Int8Array != = 'object' ) {
4526
4520
/**
4527
4521
* Checks if the passed in value is a function
4528
4522
* @param {* } val
4529
4523
* @return {boolean }
4530
4524
*/
4531
4525
exports . isFunction = function ( obj ) {
4532
- return typeof obj == 'function' || false
4526
+ return typeof obj === 'function' || false
4533
4527
}
4534
4528
} else {
4535
4529
/**
@@ -4561,7 +4555,9 @@ return /******/ (function(modules) { // webpackBootstrap
4561
4555
exports . extend = function ( obj ) {
4562
4556
var length = arguments . length
4563
4557
4564
- if ( ! obj || length < 2 ) return obj || { }
4558
+ if ( ! obj || length < 2 ) {
4559
+ return obj || { }
4560
+ }
4565
4561
4566
4562
for ( var index = 1 ; index < length ; index ++ ) {
4567
4563
var source = arguments [ index ]
@@ -4583,7 +4579,9 @@ return /******/ (function(modules) { // webpackBootstrap
4583
4579
* @return {object }
4584
4580
*/
4585
4581
exports . clone = function ( obj ) {
4586
- if ( ! exports . isObject ( obj ) ) return obj
4582
+ if ( ! exports . isObject ( obj ) ) {
4583
+ return obj
4584
+ }
4587
4585
return exports . isArray ( obj ) ? obj . slice ( ) : exports . extend ( { } , obj )
4588
4586
}
4589
4587
@@ -4600,24 +4598,29 @@ return /******/ (function(modules) { // webpackBootstrap
4600
4598
exports . each = function ( collection , iteratee , context ) {
4601
4599
var length = collection ? collection . length : 0
4602
4600
var i = - 1
4603
- var keys , origIteratee
4601
+ var keys
4602
+ var origIteratee
4604
4603
4605
4604
if ( context ) {
4606
4605
origIteratee = iteratee
4607
- iteratee = function ( value , index , collection ) {
4608
- return origIteratee . call ( context , value , index , collection )
4606
+ iteratee = function ( value , index , innerCollection ) {
4607
+ return origIteratee . call ( context , value , index , innerCollection )
4609
4608
}
4610
4609
}
4611
4610
4612
4611
if ( isLength ( length ) ) {
4613
4612
while ( ++ i < length ) {
4614
- if ( iteratee ( collection [ i ] , i , collection ) === false ) break
4613
+ if ( iteratee ( collection [ i ] , i , collection ) === false ) {
4614
+ break
4615
+ }
4615
4616
}
4616
4617
} else {
4617
4618
keys = Object . keys ( collection )
4618
4619
length = keys . length
4619
4620
while ( ++ i < length ) {
4620
- if ( iteratee ( collection [ keys [ i ] ] , keys [ i ] , collection ) === false ) break
4621
+ if ( iteratee ( collection [ keys [ i ] ] , keys [ i ] , collection ) === false ) {
4622
+ break
4623
+ }
4621
4624
}
4622
4625
}
4623
4626
@@ -4648,7 +4651,7 @@ return /******/ (function(modules) { // webpackBootstrap
4648
4651
* @return {string }
4649
4652
*/
4650
4653
function objectToString ( obj ) {
4651
- return obj && typeof obj == 'object' && toString . call ( obj )
4654
+ return obj && typeof obj === 'object' && toString . call ( obj )
4652
4655
}
4653
4656
4654
4657
/**
@@ -4658,9 +4661,9 @@ return /******/ (function(modules) { // webpackBootstrap
4658
4661
* @return {bool }
4659
4662
*/
4660
4663
function isLength ( val ) {
4661
- return typeof val == 'number'
4664
+ return typeof val === 'number'
4662
4665
&& val > - 1
4663
- && val % 1 == 0
4666
+ && val % 1 === 0
4664
4667
&& val <= Number . MAX_VALUE
4665
4668
}
4666
4669
@@ -4669,6 +4672,7 @@ return /******/ (function(modules) { // webpackBootstrap
4669
4672
/* 9 */
4670
4673
/***/ function ( module , exports , __webpack_require__ ) {
4671
4674
4675
+ /* eslint-disable no-console */
4672
4676
/**
4673
4677
* Wraps a Reactor.react invocation in a console.group
4674
4678
*/
@@ -4702,6 +4706,7 @@ return /******/ (function(modules) { // webpackBootstrap
4702
4706
console . groupEnd ( )
4703
4707
}
4704
4708
}
4709
+ /* eslint-enable no-console */
4705
4710
4706
4711
4707
4712
/***/ } ,
@@ -4771,16 +4776,16 @@ return /******/ (function(modules) { // webpackBootstrap
4771
4776
* @return {function } unwatch function
4772
4777
*/
4773
4778
ChangeObserver . prototype . onChange = function ( getter , handler ) { "use strict" ;
4774
- // TODO make observers a map of <Getter> => { handlers }
4779
+ // TODO: make observers a map of <Getter> => { handlers }
4775
4780
var entry = {
4776
4781
getter : getter ,
4777
4782
handler : handler ,
4778
4783
}
4779
4784
this . __observers . push ( entry )
4780
4785
// return unwatch function
4781
4786
return function ( ) {
4782
- // TODO untrack from change emitter
4783
- var ind = this . __observers . indexOf ( entry )
4787
+ // TODO: untrack from change emitter
4788
+ var ind = this . __observers . indexOf ( entry )
4784
4789
if ( ind > - 1 ) {
4785
4790
this . __observers . splice ( ind , 1 )
4786
4791
}
@@ -4817,7 +4822,7 @@ return /******/ (function(modules) { // webpackBootstrap
4817
4822
var isGetter = __webpack_require__ ( 5 ) . isGetter
4818
4823
4819
4824
// Keep track of whether we are currently executing a Getter's computeFn
4820
- var __applyingComputeFn = false ;
4825
+ var __applyingComputeFn = false
4821
4826
4822
4827
4823
4828
function Evaluator ( ) { "use strict" ;
@@ -4851,7 +4856,7 @@ return /******/ (function(modules) { // webpackBootstrap
4851
4856
// if its a keyPath simply return
4852
4857
return state . getIn ( keyPathOrGetter )
4853
4858
} else if ( ! isGetter ( keyPathOrGetter ) ) {
4854
- throw new Error ( " evaluate must be passed a keyPath or Getter" )
4859
+ throw new Error ( ' evaluate must be passed a keyPath or Getter' )
4855
4860
}
4856
4861
4857
4862
// Must be a Getter
@@ -4883,7 +4888,7 @@ return /******/ (function(modules) { // webpackBootstrap
4883
4888
// Throw an error as this will lead to inconsistent caching
4884
4889
if ( __applyingComputeFn === true ) {
4885
4890
__applyingComputeFn = false
4886
- throw new Error ( " Evaluate may not be called within a Getters computeFn" )
4891
+ throw new Error ( ' Evaluate may not be called within a Getters computeFn' )
4887
4892
}
4888
4893
4889
4894
__applyingComputeFn = true
@@ -4943,7 +4948,7 @@ return /******/ (function(modules) { // webpackBootstrap
4943
4948
* @param {Getter }
4944
4949
*/
4945
4950
Evaluator . prototype . untrack = function ( getter ) { "use strict" ;
4946
- // TODO untrack all depedencies
4951
+ // TODO: untrack all depedencies
4947
4952
} ;
4948
4953
4949
4954
Evaluator . prototype . reset = function ( ) { "use strict" ;
0 commit comments