Skip to content

Commit c8a4686

Browse files
committed
fix(carousel): interval prop value change should set/reset timer, closes #214 - thanks @baloo32
1 parent ba6864a commit c8a4686

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: projects/coreui-angular/src/lib/carousel/carousel/carousel.component.ts

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
AfterContentInit,
33
Component,
44
DestroyRef,
5+
effect,
56
ElementRef,
67
Inject,
78
inject,
@@ -98,6 +99,10 @@ export class CarouselComponent implements OnInit, OnDestroy, AfterContentInit {
9899
computation: (value: number) => value
99100
});
100101

102+
readonly #intervalEffect = effect(() => {
103+
this.interval() ? this.setTimer() : this.resetTimer();
104+
});
105+
101106
/**
102107
* Sets which event handlers you’d like provided to your pause prop. You can specify one trigger or an array of them.
103108
* @return {'hover' | 'focus' | 'click'}

0 commit comments

Comments
 (0)