Skip to content

Commit

Permalink
Added Missed jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-wedensday committed Apr 11, 2024
1 parent de4a313 commit 15c6884
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 7 deletions.
6 changes: 5 additions & 1 deletion app/components/atoms/LanguageProvider/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
*/

import { CHANGE_LOCALE } from './constants';

/**
* Changes the locale/language of the application.

Check warning on line 9 in app/components/atoms/LanguageProvider/actions.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹 Function is not covered

Warning! Not covered function
* @param {string} languageLocale - The new locale/language to set.
* @returns {object} An action object with type 'CHANGE_LOCALE' and the new locale/language.
*/
export function changeLocale(languageLocale) {

Check warning on line 13 in app/components/atoms/LanguageProvider/actions.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
return {
type: CHANGE_LOCALE,
Expand Down
15 changes: 13 additions & 2 deletions app/components/atoms/LanguageProvider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ import { createSelector } from 'reselect';
import { IntlProvider } from 'react-intl';

import { makeSelectLocale } from './selectors';

/**
* Provides internationalization (i18n) support by wrapping components with an IntlProvider.
* @param {object} props - The props object containing component properties.
* @param {string} props.locale - The locale/language code for internationalization.
* @param {object} props.messages - An object containing locale-specific message translations.
* @param {React.ReactNode} props.children - The child elements/components to be wrapped and rendered.
* @returns {React.ReactNode} A JSX element wrapping the provided child components with IntlProvider.
*/
export function LanguageProvider(props) {
return (
<IntlProvider
Expand All @@ -35,7 +42,11 @@ LanguageProvider.propTypes = {
const mapStateToProps = createSelector(makeSelectLocale(), locale => ({
locale
}));

/**
* Generates and returns an object containing action dispatch functions.
* @param {function} dispatch - The Redux store's dispatch function.
* @returns {object} An object containing action dispatch functions wrapped for use in components.
*/
function mapDispatchToProps(dispatch) {
return {
dispatch
Expand Down
7 changes: 6 additions & 1 deletion app/components/molecules/LogoWithInstructions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ const Instructions = styled(T)`
margin-bottom: 5;
font-style: italic;
`;

/**
* A component that displays a logo along with instructions.
* @param {object} props - The props object containing component properties.
* @param {string} props.instructions - The instructions text to display.
* @returns {React.ReactNode} JSX elements displaying the logo and instructions.
*/
function LogoWithInstructions({ instructions }) {
return (
<View>
Expand Down
9 changes: 8 additions & 1 deletion app/components/organisms/SimpsonsLoveWednesday/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ const SeparatedView = styled.View`
margin: 10px;
}
`;

/**
* A component that displays Simpsons-themed content related to Wednesday, including instructions, character details, and error messages.
* @param {object} props - The props object containing component properties.
* @param {string} props.instructions - The instructions text to display.
* @param {object} props.user - The user object representing character details and quote.
* @param {string} props.userErrorMessage - The error message to display if user data retrieval fails.
* @returns {React.ReactNode} JSX elements displaying Simpsons-themed content based on provided props.
*/
function SimpsonsLoveWednesday({ instructions, user, userErrorMessage }) {
return (
<>
Expand Down
6 changes: 5 additions & 1 deletion app/rootSaga.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { fork } from 'redux-saga/effects';
import exampleSaga from '@scenes/ExampleScreen/saga';
import startupSaga from '@scenes/RootScreen/saga';

/**
* Root saga generator function that orchestrates other sagas.
* This function sets up and manages the execution of multiple sagas using fork effects.
* @returns {IterableIterator<any>} An iterator for managing the execution of sagas.
*/
export default function* root() {
yield fork(exampleSaga);
yield fork(startupSaga);
Expand Down
6 changes: 5 additions & 1 deletion app/scenes/ExampleScreen/saga.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export function* fetchUser() {
);
}
}

/**
* Saga responsible for managing user search requests and fetching user data.
* Watches for specific action types and triggers corresponding worker sagas.
* @returns {IterableIterator<any>} An iterator for handling user search and data fetching.
*/
export default function* searchListContainerSaga() {
yield takeLatest(exampleScreenTypes.REQUEST_FETCH_USER, fetchUser);
}
7 changes: 7 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Configure Babel for Expo project with module resolution aliases.
* This function sets up Babel presets and plugins, including module resolution with aliases.
* @param {object} api - The Babel API object (optional, used for caching).
* @param {Function} api.cache - Function used for caching Babel configuration.
* @returns {object} Babel configuration object with presets and plugins.
*/
module.exports = function(api = { cache: () => {} }) {
api.cache(true);
return {
Expand Down

0 comments on commit 15c6884

Please sign in to comment.