Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(notify): add NewWithServices() constructor function #259

Merged
merged 3 commits into from
Apr 25, 2022

Conversation

nikoksr
Copy link
Owner

@nikoksr nikoksr commented Apr 25, 2022

Description

NewWithServices() accepts a variadic list of services and returns a new, by New() created, Notify instance with the list of services set as its notifiers.

If no services are given it's the functionally identical to just calling New() directly. Calling NewWithServices() with a list of services is functionally equal to calling New() and then UseServices().

Motivation and Context

A small convenience construcor that potentially saves one or more additional function calls.

How Has This Been Tested?

Added tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

AddNewWithServices() accepts a variadic list of services and returns a
new, by New() created, Notify instance with the list of services set as
its notifiers.

If no services are given it's the functionally identical to just calling
New().

Calling NewWithServices() with a list of services is functionally equal
to calling New() and then UseServices().
@nikoksr nikoksr added the type/feature New feature or request label Apr 25, 2022
@nikoksr nikoksr merged commit 5e758e2 into main Apr 25, 2022
@nikoksr nikoksr deleted the feat/new-with-services branch April 25, 2022 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M type/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant