Skip to content
This repository was archived by the owner on Aug 17, 2023. It is now read-only.
This repository was archived by the owner on Aug 17, 2023. It is now read-only.

introduce group subscription handlers #10

@ethernian

Description

@ethernian

it should be possible to define event handlers on the global level of the feature or on the group of the same buttons. These events will cause changes on widgets initiated from outside.

sketching idea

class SomeFeature implements IFeature {
   @Load('likesService.public.name') 
   private likesService;
   ...
    button({ // `this` is bound to the button instance
        label: likesService.send(this)
              .on(()=>this.state=WAITING)  //null filter may stay for subscription status events
              .on('likeChanged', likeNr => this.label=likeNr)    // likeNr changed by *this* widget 
        ...
        on : {
               tx_running: ()=> this.state=WAITING;
               like_changes: (likeNr) => this.like = likeNr; // likeNr changed by *some other* widget 
        }
     });
   ...
}//clazz

Metadata

Metadata

Assignees

No one assigned

    Labels

    in discussionin discussion. do not implement.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions