w11k / angular-sticky-things

Sticky Directive for Angular 2+

Home Page:https://w11k.github.io/angular-sticky-things

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable flag handling

aleesaan opened this issue · comments

I just had a look at the new stream approach and think it's much better to have everything unified in one stream!
Yet, I think the logic of the enable flag should be separate, as it was before. This is for two reasons:

  1. At the moment we keep the subscription always open (even when enable = false), which will emit / trigger the logic every scroll and resize.
  2. I don't really like the additional filterGate logic you had to add to handle this, and it could be simplified by using the previous approach.

In my opinion the enable logic should be outside of the stream, and just be used with OnChanges to dynamically subscribe/unsubscribe to the stream (which will then contain only info relative to the sticky element itself, not activation logic).

Let me know what you think, and if you also agree I can open a PR!

hello @aleesaan i took over this project from a former co-worker. if this is still an issue for you, please make a pr and I'll take a look.