File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -80,13 +80,21 @@ export class Service extends EventEmitter {
8080 newState . lastUpdated = Date . now ( ) ;
8181 delete newState . extraMessages ;
8282
83+ if ( this . parameters && this . constructor . parametersSpec ) {
84+ if ( ! newState . meta ) {
85+ newState . meta = { } ;
86+ }
87+ newState . meta . parameters = this . parameters ;
88+ }
89+
8390 this . emit ( Events . STATE_CHANGE , newState ) ;
8491 this . _prevState = newState ;
8592 }
8693
8794 /**
88- * Adds start time and UUID to the manifest, and if a deep equality check
89- * fails, emits an event with the new manifest then updates our state.
95+ * Adds start time, UUID and parameters (if appropriate) to the manifest, and
96+ * if a deep equality check fails, emits an event with the new manifest then
97+ * updates our state.
9098 */
9199 onManifestChange ( newManifest ) {
92100 const newManifestWithStartTime = {
@@ -95,6 +103,10 @@ export class Service extends EventEmitter {
95103 uuid : this . service . uuid
96104 } ;
97105
106+ if ( this . constructor . parametersSpec ) {
107+ newManifestWithStartTime . parameters = this . constructor . parametersSpec ;
108+ }
109+
98110 if ( ! deepEqual ( newManifestWithStartTime , this . _prevState . manifest ) ) {
99111 this . emit ( Events . MANIFEST_CHANGE , newManifestWithStartTime ) ;
100112 this . onStateChange ( { manifest : newManifestWithStartTime } ) ;
You can’t perform that action at this time.
0 commit comments