File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -115,8 +115,9 @@ export default function addRegistrationAPI(publicAPI, model) {
115115 return null ;
116116 }
117117 const definition = definitions [ group ] [ name ] ;
118+ const definitionOptions = Object . assign ( { } , definition . options , options ) ;
118119 const proxy = definition . class . newInstance (
119- Object . assign ( { } , definition . options , options , {
120+ Object . assign ( { } , definitionOptions , {
120121 proxyGroup : group ,
121122 proxyName : name ,
122123 proxyManager : publicAPI ,
@@ -144,7 +145,7 @@ export default function addRegistrationAPI(publicAPI, model) {
144145
145146 registerProxy ( proxy ) ;
146147
147- if ( ( definition . options || { } ) . activateOnCreate ) {
148+ if ( definitionOptions . activateOnCreate ) {
148149 proxy . activate ( ) ;
149150 }
150151
Original file line number Diff line number Diff line change @@ -79,23 +79,17 @@ test('Proxy activation via config', (t) => {
7979} ) ;
8080
8181test ( 'Proxy activation via .activate()' , ( t ) => {
82- const proxyManager = newProxyManager ( {
83- definitions : {
84- Sources : {
85- TrivialProducer : {
86- class : vtkTestProxyClass ,
87- options : { } ,
88- } ,
89- } ,
90- } ,
91- } ) ;
82+ const proxyManager = newProxyManager ( ) ;
9283 t . equal (
9384 proxyManager . getActiveSource ( ) ,
9485 undefined ,
9586 'No initial active source'
9687 ) ;
9788
98- const proxy = proxyManager . createProxy ( 'Sources' , 'TrivialProducer' ) ;
89+ const proxy = proxyManager . createProxy ( 'Sources' , 'TrivialProducer' , {
90+ // Inhibit the default { activateOnCreate: true }
91+ activateOnCreate : false ,
92+ } ) ;
9993 t . equal (
10094 proxyManager . getActiveSource ( ) ,
10195 undefined ,
You can’t perform that action at this time.
0 commit comments