You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* A Message does not change the state of the app and is not persisted in any way, it used to exchange payloads between custom-elements.
216
+
* A custom-element can listen for a specific message, retrieve its payload and fire a callback when this happens.
217
+
*/
175
218
exportclassMessageextendsBaseState{
176
219
sendMessage(input){
177
220
this._call_watchers(input);
@@ -241,6 +284,16 @@ let baseMixin = (listOfComponents, baseClass) => class extends baseClass {
241
284
}
242
285
}
243
286
};
287
+
/**
288
+
* This is a mixin to be applied to a generic web-component. For any **stateVariables** in the list will add to the element a read-only property
289
+
* named as the stateVariable. It will add an **applyTransition** method to dispatch the added
290
+
* transition (either of a stateVariable or of a global stateTransition). Callbacks to react on stateVariable change needs to be overwritten by the user
291
+
* and have a predefiend naming scheme: **on_"stateVarName"_update**. Callbacks to react to transitions are instead called **on_"stateTransitionName"**,
292
+
* in the latter case also the transition input data are passed. For any **Message** in the list a **gotMessage_"messageName"** callback is added to react
293
+
* to message exchange, this callback passes as input the message payload.
294
+
* @param listOfComponents is a list of StateVariables and StateTransition to add to the web-component
295
+
* @param baseClass The class on which the mixin is applied
@@ -212,6 +249,10 @@ export class StateVariable extends BaseState{
212
249
213
250
}
214
251
252
+
/**
253
+
* A Message does not change the state of the app and is not persisted in any way, it used to exchange payloads between custom-elements.
254
+
* A custom-element can listen for a specific message, retrieve its payload and fire a callback when this happens.
255
+
*/
215
256
exportclassMessageextendsBaseState{
216
257
sendMessage(input:any) :void{
217
258
this._call_watchers(input);
@@ -297,8 +338,16 @@ let baseMixin = (listOfComponents:Array<StateVariable|StateTransition|Message>,
297
338
298
339
}
299
340
300
-
301
-
341
+
/**
342
+
* This is a mixin to be applied to a generic web-component. For any **stateVariables** in the list will add to the element a read-only property
343
+
* named as the stateVariable. It will add an **applyTransition** method to dispatch the added
344
+
* transition (either of a stateVariable or of a global stateTransition). Callbacks to react on stateVariable change needs to be overwritten by the user
345
+
* and have a predefiend naming scheme: **on_"stateVarName"_update**. Callbacks to react to transitions are instead called **on_"stateTransitionName"**,
346
+
* in the latter case also the transition input data are passed. For any **Message** in the list a **gotMessage_"messageName"** callback is added to react
347
+
* to message exchange, this callback passes as input the message payload.
348
+
* @param listOfComponents is a list of StateVariables and StateTransition to add to the web-component
349
+
* @param baseClass The class on which the mixin is applied
0 commit comments