Products Added To List event
This article provides reference material about the "Products Added To List" event. The Sana core system emits this event when products are added to a list (order template).
The custom RxJS operator
The custom RxJS operator that filters an Observable of actions into the products added to list Observable.
type ProductsAddedToListInfo = {
productIds: string[];
listId: string;
};
export function onProductsAddedToList(): (source$: Observable<Action>) => Observable<ProductsAddedToListInfo>;
| Property | Type | Description |
|---|---|---|
| productIds | string[] | The added product identifiers. |
| listId | string | The list (order template) identifier. |
Example:
import { onProductsAddedToList } from 'sana/events';
const productsAddedToList$ = action$.pipe(
onProductsAddedToList(),
map(result => trackAddToWishlist(result.productIds, result.listId)),
);