Skip to content
New issue

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

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

Already on GitHub? # to your account

Proposal: subscribeAsEmit helper method #68

Open
paulpdaniels opened this issue Feb 6, 2018 · 0 comments
Open

Proposal: subscribeAsEmit helper method #68

paulpdaniels opened this issue Feb 6, 2018 · 0 comments

Comments

@paulpdaniels
Copy link

Admittedly a fairly trivial helper, but I know it would help with some boiler plate. And it gives a nice symmetry to the $fromEvent helpers

Basically:

function $subscribeAsEmit (name) {
  return (observable) => observable.subscribe(event => this.$emit(name, event))
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant