import { ActionTypes } from "./actionTypes" ; import { AppStore } from "../store" ; import { Bundle } from "../linker" ; export default function ( bundle ) { bundle . defineAction ( ActionTypes . SubtitlesBandBeginMove ) ; bundle . addReducer ( ActionTypes . SubtitlesBandBeginMove , subtitlesBandBeginMoveReducer ) ; bundle . defineAction ( ActionTypes . SubtitlesBandEndMove ) ; bundle . addReducer ( ActionTypes . SubtitlesBandEndMove , subtitlesBandEndMoveReducer ) ; bundle . defineAction ( ActionTypes . SubtitlesBandMoved ) ; bundle . addReducer ( ActionTypes . SubtitlesBandMoved , subtitlesBandMovedReducer ) ; } function subtitlesBandBeginMoveReducer ( state , { payload : { y } } ) { state . subtitles . isMoving = true ; state . subtitles . startY = y ; } function subtitlesBandEndMoveReducer ( state ) { state . subtitles . isMoving = false ; } function subtitlesBandMovedReducer ( state , { payload : { y } } ) { state . subtitles . offsetY = 10 - ( y - state . subtitles . startY ) ; }