(
{ mode, weight, duration }: ControlValue<Mode>,
off?: Mode,
)
| 10 | import { changeKey, latestChanges, useFeedTuneState } from './useFeedTuneState'; |
| 11 | |
| 12 | const toControl = <Mode>( |
| 13 | { mode, weight, duration }: ControlValue<Mode>, |
| 14 | off?: Mode, |
| 15 | ): FeedControl<Mode> | undefined => |
| 16 | mode || weight !== undefined |
| 17 | ? { |
| 18 | mode: weight === 0 && off ? off : (mode ?? null), |
| 19 | weight: weight || null, |
| 20 | expiresAt: getExpiresAt(duration), |
| 21 | } |
| 22 | : undefined; |
| 23 | |
| 24 | export interface UseFeedTune extends UseFeedTuneState { |
| 25 | feedControls: UseFeedControls; |
no test coverage detected