1
- /******/ ( function ( modules ) { // webpackBootstrap
1
+ ( function webpackUniversalModuleDefinition ( root , factory ) {
2
+ if ( typeof exports === 'object' && typeof module === 'object' )
3
+ module . exports = factory ( ) ;
4
+ else if ( typeof define === 'function' && define . amd )
5
+ define ( [ ] , factory ) ;
6
+ else {
7
+ var a = factory ( ) ;
8
+ for ( var i in a ) ( typeof exports === 'object' ? exports : root ) [ i ] = a [ i ] ;
9
+ }
10
+ } ) ( this , function ( ) {
11
+ return /******/ ( function ( modules ) { // webpackBootstrap
2
12
/******/ // The module cache
3
13
/******/ var installedModules = { } ;
4
14
/******/
63
73
/******/ __webpack_require__ . p = "" ;
64
74
/******/
65
75
/******/ // Load entry module and return exports
66
- /******/ return __webpack_require__ ( __webpack_require__ . s = 13 ) ;
76
+ /******/ return __webpack_require__ ( __webpack_require__ . s = 14 ) ;
67
77
/******/ } )
68
78
/************************************************************************/
69
79
/******/ ( [
@@ -259,9 +269,9 @@ const rawToProxy = new WeakMap()
259
269
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
260
270
261
271
"use strict" ;
262
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nextTick__ = __webpack_require__ ( 10 ) ;
263
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__builtIns_index__ = __webpack_require__ ( 9 ) ;
264
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__store__ = __webpack_require__ ( 11 ) ;
272
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nextTick__ = __webpack_require__ ( 12 ) ;
273
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__builtIns_index__ = __webpack_require__ ( 11 ) ;
274
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__store__ = __webpack_require__ ( 13 ) ;
265
275
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internals__ = __webpack_require__ ( 1 ) ;
266
276
/* harmony export (immutable) */ __webpack_exports__ [ "d" ] = observe ;
267
277
/* unused harmony export unobserve */
@@ -424,9 +434,38 @@ function runObserver (observer) {
424
434
/* 4 */
425
435
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
426
436
437
+ "use strict" ;
438
+ /* harmony export (immutable) */ __webpack_exports__ [ "a" ] = autoBind ;
439
+ const reactInternals = new Set ( [
440
+ 'constructor' ,
441
+ 'render' ,
442
+ 'componentWillMount' ,
443
+ 'componentDidMount' ,
444
+ 'componentWillReceiveProps' ,
445
+ 'shouldComponentUpdate' ,
446
+ 'componentWillUpdate' ,
447
+ 'componentDidUpdate' ,
448
+ 'componentWillUnmount'
449
+ ] )
450
+
451
+ function autoBind ( context , proto , isReact ) {
452
+ for ( let key of Object . getOwnPropertyNames ( proto ) ) {
453
+ const value = proto [ key ]
454
+
455
+ if ( typeof value === 'function' && ! ( isReact && reactInternals . has ( key ) ) ) {
456
+ context [ key ] = value . bind ( context )
457
+ }
458
+ }
459
+ }
460
+
461
+
462
+ /***/ } ) ,
463
+ /* 5 */
464
+ /***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
465
+
427
466
"use strict" ;
428
467
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nx_js_observer_util__ = __webpack_require__ ( 2 ) ;
429
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autoBind__ = __webpack_require__ ( 12 ) ;
468
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autoBind__ = __webpack_require__ ( 4 ) ;
430
469
/* harmony export (immutable) */ __webpack_exports__ [ "a" ] = easyStateHOC ;
431
470
432
471
@@ -436,10 +475,14 @@ const IS_DIRECT_RENDER = Symbol('is direct render')
436
475
const RENDER_RESULT = Symbol ( 'render result' )
437
476
438
477
function easyStateHOC ( WrappedComp ) {
478
+ if ( typeof WrappedComp !== 'function' ) {
479
+ throw new TypeError ( 'easyComp expects a class component as argument.' )
480
+ }
481
+
439
482
return class EasyStateWrapper extends WrappedComp {
440
483
constructor ( props ) {
441
484
super ( props )
442
- __webpack_require__ . i ( __WEBPACK_IMPORTED_MODULE_1__autoBind__ [ "a" /* default */ ] ) ( this , WrappedComp . prototype )
485
+ __webpack_require__ . i ( __WEBPACK_IMPORTED_MODULE_1__autoBind__ [ "a" /* default */ ] ) ( this , WrappedComp . prototype , true )
443
486
this . state = __webpack_require__ . i ( __WEBPACK_IMPORTED_MODULE_0__nx_js_observer_util__ [ "a" /* observable */ ] ) ( this . state )
444
487
}
445
488
@@ -486,7 +529,29 @@ function easyStateHOC (WrappedComp) {
486
529
487
530
488
531
/***/ } ) ,
489
- /* 5 */
532
+ /* 6 */
533
+ /***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
534
+
535
+ "use strict" ;
536
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__nx_js_observer_util__ = __webpack_require__ ( 2 ) ;
537
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autoBind__ = __webpack_require__ ( 4 ) ;
538
+ /* harmony export (immutable) */ __webpack_exports__ [ "a" ] = easyStore ;
539
+
540
+
541
+
542
+ function easyStore ( store ) {
543
+ if ( typeof store !== 'object' ) {
544
+ throw new TypeError ( 'easyStore expects an object as argument.' )
545
+ }
546
+
547
+ const observableStore = __webpack_require__ . i ( __WEBPACK_IMPORTED_MODULE_0__nx_js_observer_util__ [ "a" /* observable */ ] ) ( store )
548
+ __webpack_require__ . i ( __WEBPACK_IMPORTED_MODULE_1__autoBind__ [ "a" /* default */ ] ) ( observableStore , store , false )
549
+ return observableStore
550
+ }
551
+
552
+
553
+ /***/ } ) ,
554
+ /* 7 */
490
555
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
491
556
492
557
"use strict" ;
@@ -510,7 +575,7 @@ function instrumentMap (target) {
510
575
511
576
512
577
/***/ } ) ,
513
- /* 6 */
578
+ /* 8 */
514
579
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
515
580
516
581
"use strict" ;
@@ -533,7 +598,7 @@ function instrumentSet (target) {
533
598
534
599
535
600
/***/ } ) ,
536
- /* 7 */
601
+ /* 9 */
537
602
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
538
603
539
604
"use strict" ;
@@ -550,7 +615,7 @@ function instrumentWeakMap (target) {
550
615
551
616
552
617
/***/ } ) ,
553
- /* 8 */
618
+ /* 10 */
554
619
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
555
620
556
621
"use strict" ;
@@ -566,14 +631,14 @@ function instrumentWeakSet (target) {
566
631
567
632
568
633
/***/ } ) ,
569
- /* 9 */
634
+ /* 11 */
570
635
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
571
636
572
637
"use strict" ;
573
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Map__ = __webpack_require__ ( 5 ) ;
574
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Set__ = __webpack_require__ ( 6 ) ;
575
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__WeakMap__ = __webpack_require__ ( 7 ) ;
576
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__WeakSet__ = __webpack_require__ ( 8 ) ;
638
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Map__ = __webpack_require__ ( 7 ) ;
639
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Set__ = __webpack_require__ ( 8 ) ;
640
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__WeakMap__ = __webpack_require__ ( 9 ) ;
641
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__WeakSet__ = __webpack_require__ ( 10 ) ;
577
642
578
643
579
644
@@ -590,7 +655,7 @@ function instrumentWeakSet (target) {
590
655
591
656
592
657
/***/ } ) ,
593
- /* 10 */
658
+ /* 12 */
594
659
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
595
660
596
661
"use strict" ;
@@ -628,7 +693,7 @@ function onTask () {
628
693
629
694
630
695
/***/ } ) ,
631
- /* 11 */
696
+ /* 13 */
632
697
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
633
698
634
699
"use strict" ;
@@ -678,48 +743,20 @@ function releaseObserver (observer) {
678
743
679
744
680
745
/***/ } ) ,
681
- /* 12 */
682
- /***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
683
-
684
- "use strict" ;
685
- /* harmony export (immutable) */ __webpack_exports__ [ "a" ] = autoBind ;
686
- const internals = new Set ( [
687
- 'constructor' ,
688
- 'render' ,
689
- 'componentWillMount' ,
690
- 'componentDidMount' ,
691
- 'componentWillReceiveProps' ,
692
- 'shouldComponentUpdate' ,
693
- 'componentWillUpdate' ,
694
- 'componentDidUpdate' ,
695
- 'componentWillUnmount'
696
- ] )
697
-
698
- function autoBind ( context , proto ) {
699
- for ( let key of Object . getOwnPropertyNames ( proto ) ) {
700
- const value = proto [ key ]
701
-
702
- if ( typeof value === 'function' && ! internals . has ( key ) ) {
703
- context [ key ] = value . bind ( context )
704
- }
705
- }
706
- }
707
-
708
-
709
- /***/ } ) ,
710
- /* 13 */
746
+ /* 14 */
711
747
/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
712
748
713
749
"use strict" ;
714
750
Object . defineProperty ( __webpack_exports__ , "__esModule" , { value : true } ) ;
715
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__easyComp__ = __webpack_require__ ( 4 ) ;
716
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__nx_js_observer_util__ = __webpack_require__ ( 2 ) ;
751
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__easyComp__ = __webpack_require__ ( 5 ) ;
752
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__easyStore__ = __webpack_require__ ( 6 ) ;
717
753
/* harmony reexport (binding) */ __webpack_require__ . d ( __webpack_exports__ , "easyComp" , function ( ) { return __WEBPACK_IMPORTED_MODULE_0__easyComp__ [ "a" ] ; } ) ;
718
- /* harmony reexport (binding) */ __webpack_require__ . d ( __webpack_exports__ , "easyStore" , function ( ) { return __WEBPACK_IMPORTED_MODULE_1__nx_js_observer_util__ [ "a" ] ; } ) ;
754
+ /* harmony reexport (binding) */ __webpack_require__ . d ( __webpack_exports__ , "easyStore" , function ( ) { return __WEBPACK_IMPORTED_MODULE_1__easyStore__ [ "a" ] ; } ) ;
719
755
720
756
721
757
722
758
723
759
724
760
/***/ } )
725
- /******/ ] ) ;
761
+ /******/ ] ) ;
762
+ } ) ;
0 commit comments