Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Custom callable functions #423

Open
basickarl opened this issue May 21, 2024 · 2 comments
Open

Feature request: Custom callable functions #423

basickarl opened this issue May 21, 2024 · 2 comments

Comments

@basickarl
Copy link

Hi! It would be really nice to make it possible to add custom functions/callbacks to toastProps.

const id = toast.custom(..., {
  customFunctions: {
    hello: ()=> console.info('hi!');
  }
})

const toast.call(id, 'hello'); // would call the custom function

something like this would be great. We want to update the internals of a toast.

@emilkowalski
Copy link
Owner

Whats your use case?

@basickarl
Copy link
Author

So we have a progress bar in one of our custom toasts, we would like to be able to call this function to update the percentage value of the progress bar inside a toast (or do any manipulation to the toast at runtime for custom toasts). I currently have this working but it's hacky DOM manipulation and would prefer to do it via a proper API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants