-
Notifications
You must be signed in to change notification settings - Fork 11
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
💡 [REQUEST] - Add onStoryChange event emitter #25
Comments
Hey @Gauravdarkslayer, Thanks for contributing and Congrats on opening Issue 🎉 We will try to review as soon as possible and a maintainer will get back to you soon! |
Hi.. |
Sure, Assigned @Ashu1823 |
Hi @Ashu1823 , |
Hi @Gauravdarkslayer sure I will through your modifications and I will follow the same way. |
Closing this issue as it's now implemented successfully ! |
Referenced Issue:
24
Summary
This request proposes the introduction of an
onStoryChange
event emitter in the ngx-stories component to notify developers when a user navigates from one story to another within a person’s story group.Event Triggering:
The
onStoryChange
event should fire every time a user moves to a different story within the same person’s story group.This event should also be triggered when the story changes automatically due to the built-in autoplay feature.
It should provide details about the newly active story, including the story index and the currently active person.
Event Payload:
The event should emit an object containing the following information:
currentPerson: Person: The person whose story is currently being viewed.
currentPersonIndex: number: The index of the currently active person in the list.
currentStory: Story: The specific story being viewed in the person’s story group.
currentStoryIndex: number: The index of the currently active story in the person’s story array.
previousStory?: Story (optional): The story that was previously viewed before the current one.
previousStoryIndex?: number (optional): The index of the previously viewed story.
Use Cases:
Story-based Analytics: Track which specific stories within a person’s group are being viewed, and for how long.
UI Updates: Modify on-screen information, such as captions, controls, or overlays, based on the currently active story type (e.g., image or video).
Autoplay Actions: Developers can respond to autoplay events and detect when a story automatically changes due to the timer.
Use Cases:
Analytics: Track how many users view specific story groups, or record the time spent on each person’s stories.
Custom UI Updates: Modify UI elements or display additional information based on the currently active person’s stories.
Conditional Logic: Trigger actions such as loading new data when a user navigates to a specific story group.
Acceptance Criteria:
The onStoryChange event is emitted every time a user moves to a different story within a person’s story group.
The event payload contains details about the currently active person, their current story, and optionally the previous story.
The event can be subscribed to and used to trigger custom logic such as analytics, dynamic content, or UI updates.
Basic Example
Drawbacks
No response
Unresolved questions
No response
The text was updated successfully, but these errors were encountered: