@@ -3,28 +3,31 @@ import CryptoJS from "crypto-js";
3
3
4
4
import { compareEntitiesInOrderedSetForSorting } from "../entity/set/ordered/utils" ;
5
5
6
- export const ApplicationContextMixinBuilder = ( applicationCls ) => ( superclass ) =>
6
+ export const ApplicationContextMixin = ( superclass ) =>
7
7
class extends superclass {
8
8
constructor ( config ) {
9
9
super ( config ) ;
10
- if ( ! applicationCls )
11
- throw Error ( "ApplicationContextMixinBuilder : applicationCls is undefined" ) ;
10
+ if ( ! this . constructor . applicationCls )
11
+ throw Error ( "ApplicationContextMixin : applicationCls is undefined" ) ;
12
12
this . _application =
13
- ( config . context && config . context . application ) || applicationCls . createDefault ( ) ;
13
+ ( config . context && config . context . application ) ||
14
+ this . constructor . applicationCls . createDefault ( ) ;
14
15
}
15
16
16
17
get application ( ) {
17
18
return this . _application ;
18
19
}
19
20
} ;
20
21
21
- export const MaterialContextMixinBuilder = ( materialCls ) => ( superclass ) =>
22
+ export const MaterialContextMixin = ( superclass ) =>
22
23
class extends superclass {
23
24
constructor ( config ) {
24
25
super ( config ) ;
25
- if ( ! materialCls ) throw Error ( "MaterialContextMixinBuilder: materialCls is undefined" ) ;
26
+ if ( ! this . constructor . materialCls ) {
27
+ throw Error ( "MaterialContextMixin: materialCls is undefined" ) ;
28
+ }
26
29
this . _material = config . context && config . context . material ;
27
- if ( ! this . _material ) this . _material = materialCls . createDefault ( ) ;
30
+ if ( ! this . _material ) this . _material = this . constructor . materialCls . createDefault ( ) ;
28
31
this . updateMaterialHash ( ) ;
29
32
}
30
33
@@ -74,14 +77,18 @@ export const MaterialsSetContextMixin = (superclass) =>
74
77
}
75
78
} ;
76
79
77
- export const MaterialsContextMixinBuilder = ( materialCls ) => ( superclass ) =>
80
+ export const MaterialsContextMixin = ( superclass ) =>
78
81
class extends superclass {
79
82
constructor ( config ) {
80
83
super ( config ) ;
81
84
const materials = this . config . context && this . config . context . materials ;
82
- if ( ! materialCls ) throw Error ( "MaterialsContextMixinBuilder: materialCls is undefined" ) ;
85
+ if ( ! this . constructor . materialCls ) {
86
+ throw Error ( "MaterialsContextMixin: materialCls is undefined" ) ;
87
+ }
83
88
this . _materials =
84
- materials && materials . length ? materials : [ materialCls . createDefault ( ) ] ;
89
+ materials && materials . length
90
+ ? materials
91
+ : [ this . constructor . materialCls . createDefault ( ) ] ;
85
92
}
86
93
87
94
get materials ( ) {
0 commit comments