Skip to content

Commit

Permalink
chore: rename ToasterSingleton class (#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov authored and amje committed Jan 31, 2025
1 parent 355d8e4 commit f2a0346
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/Toaster/Provider/ToasterProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import * as React from 'react';

import type {ToasterSingleton} from '../ToasterSingleton';
import type {Toaster} from '../Toaster';
import type {InternalToastProps} from '../types';

import {ToasterContext} from './ToasterContext';
import {ToastsContext} from './ToastsContext';

type Props = React.PropsWithChildren<{
toaster: ToasterSingleton;
toaster: Toaster;
}>;

export const ToasterProvider = ({toaster, children}: Props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {getToastIndex} from './utilities/getToastIndex';
import {hasToast} from './utilities/hasToast';
import {removeToast} from './utilities/removeToast';

export class ToasterSingleton {
export class Toaster {
/** We were tried to notify about toaster changes, but no one were listened */
private hasUndelivered = false;
private toasts: InternalToastProps[] = [];
Expand Down
2 changes: 1 addition & 1 deletion src/components/Toaster/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {ToasterSingleton as Toaster} from './ToasterSingleton';
export {Toaster} from './Toaster';
export {Toast} from './Toast/Toast';

export * from './types';
Expand Down
4 changes: 2 additions & 2 deletions src/toaster-singleton.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import {ToasterSingleton} from './components/Toaster/ToasterSingleton';
import {Toaster} from './components/Toaster/Toaster';

export const toaster = new ToasterSingleton();
export const toaster = new Toaster();

0 comments on commit f2a0346

Please sign in to comment.