ngneat / hot-toast

🍞 Smoking hot Notifications for Angular. Lightweight, customizable and beautiful by default.

Home Page:https://ngneat.github.io/hot-toast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Options for Service.observe

Coly010 opened this issue · comments

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

The observe function does not allow passing a config object.

observe<T, DataType>(messages: ObservableMessages<T, DataType>): (source: Observable<T>) => Observable<T> {

Expected behavior

We should be able to pass config options similar to:

show<DataType>(message?: Content, options?: ToastOptions<DataType>): CreateHotToastRef<DataType | unknown> {

You can pass config for each state:

this.toast.observe({
    loading: { content: "Preparing toast", style: { width: "200px" }, icon: '⏳' },
}),