Multiple instances creation
everyonesdesign opened this issue · 4 comments
I can't find a way to create multiple instances of InView.
'in-view.js' default export allows to get already created instance (see source). I also can't import InView variable as it's not exported (see source).
@gabrielflorit mentioned in issue #36 that he deals with the issue via creation of multiple InView objects, but I don't see any way to do this.
I'd suggest the variable exporting, because it seems to be the most non-destructive change.
Thank you.
I also have a need to create different offsets per selector. Is this something that can be done?
@njbarrett I eventually ended up forking the repo: https://github.com/kudago/in-view
I commited some changes here, maybe I'll create pull request to original repo (or some other person will do it).
You can use it like this:
import InViewFactory from 'kudago-in-view';
const inView1 = InViewFactory();
inView.offset(-100);
const inView2 = InViewFactory();
inView.offset(-200);
// etc...
Thanks heaps for responding - ill check your fork out!
Sorry @everyonesdesign , a bit late to this. Yes, I created my own fork a while back, does the same thing as yours. I'd say, keep using your fork!