Skip to content

Commit

Permalink
Renamed start/stop holyProgress to holyLoader
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Rumpf <35841182+tomcru@users.noreply.github.com>
  • Loading branch information
lorikku and tomcru authored Apr 23, 2024
1 parent 7737aca commit c242c3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ Have an async operation before an eventual route change? You might be interested
```typescript
'use client';

import { startHolyProgress, stopHolyProgress } from 'holy-loader';
import { startHolyLoader, stopHolyLoader } from 'holy-loader';

try {
startHolyProgress(); // Trigger the loader beforehand
startHolyLoader(); // Trigger the loader beforehand
await signOut(); // Example async operation
} catch (error) {
stopHolyProgress(); // Stop the loader on error
stopHolyLoader(); // Stop the loader on error
// Handle the error
} finally {
stopHolyProgress(); // Stop the loader after the operation, and potentially do something else
stopHolyLoader(); // Stop the loader after the operation, and potentially do something else
/* OR */
router.push('/'); // Navigate to the desired route, which will automatically stop the loader
}
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ export const isSameHost = (currentUrl: string, newUrl: string): boolean => {
/**
* Dispatches the event to manually start the HolyLoader progress bar.
*/
export const startHolyProgress = (): void => {
export const startHolyLoader = (): void => {
document.dispatchEvent(new Event(START_HOLY_EVENT));
};

/**
* Dispatches the event to manually stop the HolyLoader progress bar.
*/
export const stopHolyProgress = (): void => {
export const stopHolyLoader = (): void => {
document.dispatchEvent(new Event(STOP_HOLY_EVENT));
};

Expand Down

0 comments on commit c242c3a

Please sign in to comment.