-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(sandbox): Organize and set some globals for convenience
- Loading branch information
Showing
6 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { swalWithReactContent } from './swalWithReactContent' | ||
import { StatefulElement } from './StatefulElement' | ||
|
||
export const example = async () => { | ||
await swalWithReactContent(<StatefulElement />) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { setGlobals } from './setGlobals' | ||
import { example } from './example' | ||
|
||
setGlobals() | ||
example().catch(console.error) |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import swal from 'sweetalert2' | ||
import sweetalert2ReactContent from '../src/main' | ||
import { swalWithReactContent } from './swalWithReactContent' | ||
|
||
export const setGlobals = () => { | ||
Object.assign(global, { | ||
swal, | ||
sweetalert2ReactContent, | ||
swalWithReactContent, | ||
}) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import swal from 'sweetalert2' | ||
import sweetalert2ReactContent from '../src/main' | ||
|
||
export const swalWithReactContent = sweetalert2ReactContent(swal) |
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