Skip to content

Commit f8afca8

Browse files
fix: [readme] remove redundant IDs from storyGroups and stories; add triggerOnStoryChange event
1 parent b97162e commit f8afca8

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,17 @@ import { NgxStoriesComponent, StoryGroup } from 'ngx-stories';
2929
export class AppComponent {
3030
storyGroups: StoryGroup[] = [
3131
{
32-
id: 1,
3332
name: 'John Doe',
3433
stories: [
35-
{ id: 101, type: 'image', content: 'https://example.com/story1.jpg' },
36-
{ id: 101, type: 'component', content: CustomComponent }, // pass any angular component to render in stories
34+
{ type: 'image', content: 'https://example.com/story1.jpg' },
35+
{ type: 'component', content: CustomComponent }, // pass any angular component to render in stories
3736
],
3837
},
3938
{
40-
id: 2,
4139
name: 'Jane Smith',
4240
stories: [
43-
{ id: 103, type: 'image', content: 'https://example.com/story3.jpg' },
44-
{ id: 3, type: 'video', content: 'https://example.com/video-story.mp4' },
41+
{ type: 'image', content: 'https://example.com/story3.jpg' },
42+
{ type: 'video', content: 'https://example.com/video-story.mp4' },
4543
],
4644
},
4745
];
@@ -61,6 +59,7 @@ export class AppComponent {
6159
| `triggerOnExit` | `EventEmitter<void>` | No | Output event that is triggered when the user manually exits the story view. |
6260
| `triggerOnSwipeUp` | `EventEmitter<void>` | No | Output event that is triggered when the user performs a swipe-up gesture, typically for additional actions. |
6361
| `onStoryGroupChange` | `EventEmitter<number>` | No | Output event that is triggered when the user changes the storyGroup.
62+
| `triggerOnStoryChange` | `EventEmitter<object>` | No | Output event that is triggered when the user changes the story.
6463

6564

6665
```ts
@@ -84,6 +83,7 @@ interface NgxStoriesOptions {
8483
* Loading: A Loading svg will be shown when story buffers (SVG from <a href="https://www.svgbackgrounds.com/elements/animated-svg-preloaders/">Animated SVG Preloaders by SVGBackgrounds.com</a>)
8584
* Audio controls: Toggle audio on/off for stories that have audio.
8685
* Component based stories for best control.
86+
* Auto-assigning unique ids to storyGroups and stories.
8787

8888
## Contributing
8989
[Contributing Guide](https://github.com/Gauravdarkslayer/ngx-stories/blob/main/CONTRIBUTING.md)

projects/ngx-stories/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,17 @@ import { NgxStoriesComponent, StoryGroup } from 'ngx-stories';
2929
export class AppComponent {
3030
storyGroups: StoryGroup[] = [
3131
{
32-
id: 1,
3332
name: 'John Doe',
3433
stories: [
35-
{ id: 101, type: 'image', content: 'https://example.com/story1.jpg' },
36-
{ id: 101, type: 'component', content: CustomComponent }, // pass any angular component to render in stories
34+
{ type: 'image', content: 'https://example.com/story1.jpg' },
35+
{ type: 'component', content: CustomComponent }, // pass any angular component to render in stories
3736
],
3837
},
3938
{
40-
id: 2,
4139
name: 'Jane Smith',
4240
stories: [
43-
{ id: 103, type: 'image', content: 'https://example.com/story3.jpg' },
44-
{ id: 3, type: 'video', content: 'https://example.com/video-story.mp4' },
41+
{ type: 'image', content: 'https://example.com/story3.jpg' },
42+
{ type: 'video', content: 'https://example.com/video-story.mp4' },
4543
],
4644
},
4745
];
@@ -61,6 +59,7 @@ export class AppComponent {
6159
| `triggerOnExit` | `EventEmitter<void>` | No | Output event that is triggered when the user manually exits the story view. |
6260
| `triggerOnSwipeUp` | `EventEmitter<void>` | No | Output event that is triggered when the user performs a swipe-up gesture, typically for additional actions. |
6361
| `onStoryGroupChange` | `EventEmitter<number>` | No | Output event that is triggered when the user changes the storyGroup.
62+
| `triggerOnStoryChange` | `EventEmitter<object>` | No | Output event that is triggered when the user changes the story.
6463

6564

6665
```ts
@@ -84,6 +83,7 @@ interface NgxStoriesOptions {
8483
* Loading: A Loading svg will be shown when story buffers (SVG from <a href="https://www.svgbackgrounds.com/elements/animated-svg-preloaders/">Animated SVG Preloaders by SVGBackgrounds.com</a>)
8584
* Audio controls: Toggle audio on/off for stories that have audio.
8685
* Component based stories for best control.
86+
* Auto-assigning unique ids to storyGroups and stories.
8787

8888
## Contributing
8989
[Contributing Guide](https://github.com/Gauravdarkslayer/ngx-stories/blob/main/CONTRIBUTING.md)

projects/ngx-stories/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-stories",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"peerDependencies": {
55
"@angular/common": "^18.2.0",
66
"@angular/core": "^18.2.0",

0 commit comments

Comments
 (0)