@braze/web-sdk
Version:
Braze SDK for web sites and other JS platforms.
25 lines (24 loc) • 594 B
JavaScript
import r from "../managers/braze-instance.js";
import i from "./banner-provider-factory.js";
import { getAllBanners } from "./get-all-banners.js";
export function subscribeToBannersUpdates(n) {
var o;
if (!r.rr()) return;
const t = i.o();
if (t.xt()) {
const r = getAllBanners();
r && "function" == typeof n && n(r);
}
const s = t.zt(n);
if (!t.Lt()) {
const n =
null === (o = r.nn()) || void 0 === o
? void 0
: o.rn(() => {
const n = t.Ct();
n && n.length > 0 && t.O(n);
});
n && t.$t(n);
}
return s;
}