UNPKG
react-toast
Version:
latest (1.0.3)
1.0.3
1.0.1
1.0.0
0.1.0
Minimal toast notifications for React.
github.com/moharnadreza/react-toast
moharnadreza/react-toast
react-toast
/
src
/
utils
/
toaster.ts
17 lines
(14 loc)
•
305 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import
{
Type
,
ToastProvider
,
Toast
}
from
'types'
export
interface
Toaster
extends
ToastProvider
{
type
:
Type
}
export
const
toaster = ({ content,
type
, config }:
Toaster
):
Toast
=>
{
return
{
id
:
Math
.
random
() .
toString
(
36
) .
substr
(
2
,
10
), content,
type
, config, } }