This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* playing sound using react-native-sound. | |
We have a list of sounds and by default we are playing the first sound in the list. | |
In order to change the sound track a user can select the file name from the list. | |
Note: | |
1. Android: Save your sound clip files under the directory android/app/src/main/res/raw. | |
Note that files in this directory must be lowercase and underscored (e.g. my_file_name.mp3) and that subdirectories are not supported by Android. | |
2. iOS: Open Xcode and add your sound files to the project (Right-click the project and select Add Files to [PROJECTNAME]) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useEffect, useState} from 'react'; | |
const ON = 'on'; | |
const OFF = 'off'; | |
const defaultTimerValue = 3; | |
const defaultTimerInterval= 1000; | |
const defaultTimeOutCallback = ()=>{alert('Time Over)}; | |
function useCountDownTimer({ | |
initialValue = defaultTimerValue, | |
interval = defaultTimerInterval, |