universal-toast
v1.2.3
Published
--- title: toast ---
Downloads
191
Keywords
Readme
title: toast
universal-toast
Universal toast, you can choose how many seconds after disappearing
Support
Install
$ npm install universal-toast --save
Usage
import Toast from 'universal-toast';
Toast.show('Hi');
Methods
Toast.show(options: object | string)
Arguments
| Property | Type | Description | Default |
| -------- | -------- | ------------------------------------------- | :-----: |
| message | string
| content of the message | - |
| type | success | fail | none
| Type of popup | none |
| duration | number
| Time in millisecond before Toast is closed. | 2000 |
| success | function
| The callback function for a successful API call | - |
| fail | function
| The callback function for a failed API call | - |
| complete | function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | - |
Toast.hide()
Hides the loading prompt box