kodadot/nft-gallery

View on GitHub
composables/useToast.ts

Summary

Maintainability
A
0 mins
Test Coverage
// vue composables api for toast message function
export default function useToast() {
  const { neoNotification } = useProgrammatic()

  // toast message function
  const toast = (
    message: string,
    { rootClass = 'is-neo-toast', duration = 5000, position = 'top' } = {},
  ) => {
    neoNotification.open({
      message,
      rootClass,
      duration,
      position,
    })
  }

  return {
    toast,
  }
}