Skip to content

Commit 8df45ff

Browse files
committed
[release] 1.0.5
1 parent b4067f7 commit 8df45ff

File tree

3 files changed

+55
-52
lines changed

3 files changed

+55
-52
lines changed

dist/nuclear.js

+49-44
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ return /******/ (function(modules) { // webpackBootstrap
127127
// arg instanceof Immutable.Sequence is unreleable
128128
return (isImmutable(arg))
129129
? arg.toJS()
130-
: arg;
130+
: arg
131131
}
132132

133133
/**
@@ -166,7 +166,7 @@ return /******/ (function(modules) { // webpackBootstrap
166166

167167
/**
168168
* 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
170170
*
171171
* The only way Reactors can change state is by reacting to
172172
* messages. To update staet, Reactor's dispatch messages to
@@ -265,7 +265,7 @@ return /******/ (function(modules) { // webpackBootstrap
265265
var newState = store.handle(currState, actionType, payload)
266266

267267
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'
269269
logging.dispatchError(error)
270270
throw new Error(error)
271271
}
@@ -294,7 +294,9 @@ return /******/ (function(modules) { // webpackBootstrap
294294
* @param {Store} store
295295
*/
296296
Reactor.prototype.registerStore=function(id, store) {"use strict";
297+
/* eslint-disable no-console */
297298
console.warn('Deprecation warning: `registerStore` will no longer be supported in 1.1, use `registerStores` instead')
299+
/* eslint-enable no-console */
298300
var stores = {}
299301
stores[id] = store
300302
this.registerStores(stores)
@@ -306,13 +308,15 @@ return /******/ (function(modules) { // webpackBootstrap
306308
Reactor.prototype.registerStores=function(stores) {"use strict";
307309
each(stores, function(store, id) {
308310
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 */
310314
}
311315

312316
var initialState = store.getInitialState()
313317

314318
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')
316320
}
317321

318322
this.__stores = this.__stores.set(id, store)
@@ -334,10 +338,10 @@ return /******/ (function(modules) { // webpackBootstrap
334338
var storeState = prevState.get(id)
335339
var resetStoreState = store.handleReset(storeState)
336340
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')
338342
}
339343
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')
341345
}
342346
state.set(id, resetStoreState)
343347
})
@@ -462,7 +466,6 @@ return /******/ (function(modules) { // webpackBootstrap
462466
/* 5 */
463467
/***/ function(module, exports, __webpack_require__) {
464468

465-
var Immutable = __webpack_require__(7)
466469
var isFunction = __webpack_require__(8).isFunction
467470
var isArray = __webpack_require__(8).isArray
468471
var isKeyPath = __webpack_require__(4).isKeyPath
@@ -507,7 +510,7 @@ return /******/ (function(modules) { // webpackBootstrap
507510
*/
508511
function fromKeyPath(keyPath) {
509512
if (!isKeyPath(keyPath)) {
510-
throw new Error("Cannot create Getter from KeyPath: " + keyPath)
513+
throw new Error('Cannot create Getter from KeyPath: ' + keyPath)
511514
}
512515

513516
return [keyPath, identity]
@@ -541,8 +544,8 @@ return /******/ (function(modules) { // webpackBootstrap
541544
component.__unwatchFns = []
542545
each(this.getDataBindings(), function(getter, key) {
543546
var unwatchFn = reactor.observe(getter, function(val) {
544-
var newState = {};
545-
newState[key] = val;
547+
var newState = {}
548+
newState[key] = val
546549
component.setState(newState)
547550
})
548551

@@ -554,7 +557,7 @@ return /******/ (function(modules) { // webpackBootstrap
554557
while (this.__unwatchFns.length) {
555558
this.__unwatchFns.shift()()
556559
}
557-
}
560+
},
558561
}
559562
}
560563

@@ -564,9 +567,9 @@ return /******/ (function(modules) { // webpackBootstrap
564567
*/
565568
function getState(reactor, data) {
566569
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+
})
570573
return state
571574
}
572575

@@ -4493,22 +4496,13 @@ return /******/ (function(modules) { // webpackBootstrap
44934496
/* 8 */
44944497
/***/ function(module, exports, __webpack_require__) {
44954498

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-
45054499
/**
45064500
* Checks if the passed in value is a string
45074501
* @param {*} val
45084502
* @return {boolean}
45094503
*/
45104504
exports.isString = function(val) {
4511-
return typeof val == 'string' || objectToString(val) === '[object String]'
4505+
return typeof val === 'string' || objectToString(val) === '[object String]'
45124506
}
45134507

45144508
/**
@@ -4522,14 +4516,14 @@ return /******/ (function(modules) { // webpackBootstrap
45224516

45234517
// taken from underscore source to account for browser descrepency
45244518
/* istanbul ignore if */
4525-
if (typeof /./ != 'function' && typeof Int8Array != 'object') {
4519+
if (typeof /./ !== 'function' && typeof Int8Array !== 'object') {
45264520
/**
45274521
* Checks if the passed in value is a function
45284522
* @param {*} val
45294523
* @return {boolean}
45304524
*/
45314525
exports.isFunction = function(obj) {
4532-
return typeof obj == 'function' || false
4526+
return typeof obj === 'function' || false
45334527
}
45344528
} else {
45354529
/**
@@ -4561,7 +4555,9 @@ return /******/ (function(modules) { // webpackBootstrap
45614555
exports.extend = function(obj) {
45624556
var length = arguments.length
45634557

4564-
if (!obj || length < 2) return obj || {}
4558+
if (!obj || length < 2) {
4559+
return obj || {}
4560+
}
45654561

45664562
for (var index = 1; index < length; index++) {
45674563
var source = arguments[index]
@@ -4583,7 +4579,9 @@ return /******/ (function(modules) { // webpackBootstrap
45834579
* @return {object}
45844580
*/
45854581
exports.clone = function(obj) {
4586-
if (!exports.isObject(obj)) return obj
4582+
if (!exports.isObject(obj)) {
4583+
return obj
4584+
}
45874585
return exports.isArray(obj) ? obj.slice() : exports.extend({}, obj)
45884586
}
45894587

@@ -4600,24 +4598,29 @@ return /******/ (function(modules) { // webpackBootstrap
46004598
exports.each = function(collection, iteratee, context) {
46014599
var length = collection ? collection.length : 0
46024600
var i = -1
4603-
var keys, origIteratee
4601+
var keys
4602+
var origIteratee
46044603

46054604
if (context) {
46064605
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)
46094608
}
46104609
}
46114610

46124611
if (isLength(length)) {
46134612
while (++i < length) {
4614-
if (iteratee(collection[i], i, collection) === false) break
4613+
if (iteratee(collection[i], i, collection) === false) {
4614+
break
4615+
}
46154616
}
46164617
} else {
46174618
keys = Object.keys(collection)
46184619
length = keys.length
46194620
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+
}
46214624
}
46224625
}
46234626

@@ -4648,7 +4651,7 @@ return /******/ (function(modules) { // webpackBootstrap
46484651
* @return {string}
46494652
*/
46504653
function objectToString(obj) {
4651-
return obj && typeof obj == 'object' && toString.call(obj)
4654+
return obj && typeof obj === 'object' && toString.call(obj)
46524655
}
46534656

46544657
/**
@@ -4658,9 +4661,9 @@ return /******/ (function(modules) { // webpackBootstrap
46584661
* @return {bool}
46594662
*/
46604663
function isLength(val) {
4661-
return typeof val == 'number'
4664+
return typeof val === 'number'
46624665
&& val > -1
4663-
&& val % 1 == 0
4666+
&& val % 1 === 0
46644667
&& val <= Number.MAX_VALUE
46654668
}
46664669

@@ -4669,6 +4672,7 @@ return /******/ (function(modules) { // webpackBootstrap
46694672
/* 9 */
46704673
/***/ function(module, exports, __webpack_require__) {
46714674

4675+
/* eslint-disable no-console */
46724676
/**
46734677
* Wraps a Reactor.react invocation in a console.group
46744678
*/
@@ -4702,6 +4706,7 @@ return /******/ (function(modules) { // webpackBootstrap
47024706
console.groupEnd()
47034707
}
47044708
}
4709+
/* eslint-enable no-console */
47054710

47064711

47074712
/***/ },
@@ -4771,16 +4776,16 @@ return /******/ (function(modules) { // webpackBootstrap
47714776
* @return {function} unwatch function
47724777
*/
47734778
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 }
47754780
var entry = {
47764781
getter: getter,
47774782
handler: handler,
47784783
}
47794784
this.__observers.push(entry)
47804785
// return unwatch function
47814786
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)
47844789
if (ind > -1) {
47854790
this.__observers.splice(ind, 1)
47864791
}
@@ -4817,7 +4822,7 @@ return /******/ (function(modules) { // webpackBootstrap
48174822
var isGetter = __webpack_require__(5).isGetter
48184823

48194824
// Keep track of whether we are currently executing a Getter's computeFn
4820-
var __applyingComputeFn = false;
4825+
var __applyingComputeFn = false
48214826

48224827

48234828
function Evaluator() {"use strict";
@@ -4851,7 +4856,7 @@ return /******/ (function(modules) { // webpackBootstrap
48514856
// if its a keyPath simply return
48524857
return state.getIn(keyPathOrGetter)
48534858
} 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')
48554860
}
48564861

48574862
// Must be a Getter
@@ -4883,7 +4888,7 @@ return /******/ (function(modules) { // webpackBootstrap
48834888
// Throw an error as this will lead to inconsistent caching
48844889
if (__applyingComputeFn === true) {
48854890
__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')
48874892
}
48884893

48894894
__applyingComputeFn = true
@@ -4943,7 +4948,7 @@ return /******/ (function(modules) { // webpackBootstrap
49434948
* @param {Getter}
49444949
*/
49454950
Evaluator.prototype.untrack=function(getter) {"use strict";
4946-
// TODO untrack all depedencies
4951+
// TODO: untrack all depedencies
49474952
};
49484953

49494954
Evaluator.prototype.reset=function() {"use strict";

0 commit comments

Comments
 (0)