-
-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better handle network related errors
Signed-off-by: Craig Bassett <[email protected]>
- Loading branch information
Showing
6 changed files
with
104 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,30 @@ | ||
import Vue from 'vue' | ||
export default new Vue() | ||
|
||
export const EventBus = { | ||
bus: new Vue(), | ||
$emit: (text?: string, type?: FlashMessageTypes, timeout?: number): void => { | ||
const opts: FlashMessage = { | ||
open: true | ||
} | ||
if (text) opts.text = text | ||
if (type) opts.type = type | ||
if (timeout) opts.timeout = timeout | ||
|
||
EventBus.bus.$emit('flashMessage', opts) // custom message | ||
} | ||
} | ||
|
||
export interface FlashMessage { | ||
type?: FlashMessageTypes; | ||
open: boolean; | ||
text?: string; | ||
timeout?: number; | ||
} | ||
|
||
export enum FlashMessageTypes { | ||
success = 'success', | ||
error = 'error', | ||
warning = 'warning', | ||
primary = 'primary', | ||
secondary = 'secondary' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters