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

getModalData should return observable #308

Open
kpogorze opened this issue Feb 10, 2021 · 1 comment
Open

getModalData should return observable #308

kpogorze opened this issue Feb 10, 2021 · 1 comment

Comments

@kpogorze
Copy link

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

getModalData returns plain js object.

Expected behavior

It should return observable that emits modal data whenever setModalData is called with given modal id

What is the motivation / use case for changing the behavior?

Better user experience when using modal data inside modal components. Now you need to subscribe on one of modal events to get modal data if it has been set after modal component has been created.

Using observables would remove this sort of temporal dependencies between component that sets the data and the modal. To use data in components only async pipe or subscribe and any changes would be applied automatically. It would also make composing data and modal events easier.

Please tell us about your environment:

  • Smart Modal version: 7.4.1

  • Angular version: 9

  • Browser: [all]
  • Language: [all]
@maximelafarie
Copy link
Owner

Hi @kpogorze,
I completely agree with you and observables are way more interesting to manipulate than plain objects. Since it'll be a BC, I put it in next major release.

🖖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants