LaxarJS / laxar-patterns

Utilities to implement standard event patterns in LaxarJS widgets
MIT License
5 stars 2 forks source link

actions: publisherForFeature should have an `optional` option #89

Closed alex3683 closed 7 years ago

alex3683 commented 7 years ago

The returned publisher should then be a noop (with respect to #88).

alex3683 commented 7 years ago

Implemented on master (v2.0.0).

New Feature

An action publisher for a feature can now be created for an optional feature configuration. In that case the resulting publisher function will do nothing more than returning a resolved promise when called. Example:

const publisher = actions.publisherForFeature( context, 'mayBeOptional', { optional: true } );
publisher().then( ... );