yarn sweetalert2 7.16.0

latest releases: 11.14.5, 11.14.4, 11.14.3...
6 years ago

swal.mixin(params) 🎉 thanks to @zenflow

Returns a wrapped instance of swal containing params as defaults.

Useful for reusing swal configuration.

Before:

const textPromptOptions = { input: 'text', showCancelButton: true }
const {value: firstName} = await swal({ ...textPromptOptions, title: 'What is your first name?' })
const {value: lastName} = await swal({ ...textPromptOptions, title: 'What is your last name?' })

After:

const myTextPrompt = swal.mixin({ input: 'text', showCancelButton: true })
const {value: firstName} = await myTextPrompt('What is your first name?')
const {value: lastName} = await myTextPrompt('What is your last name?')

Don't miss a new sweetalert2 release

NewReleases is sending notifications on new releases.