Last active
July 31, 2019 17:58
-
-
Save agaerig/33827f11ff2cb31f0e8678d11ed855ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sku = 'swg_stepped_pricing_test'; | |
| const getWindowSwg = (context = window) => { | |
| // eslint-disable-next-line compat/compat | |
| return new Promise((resolve, _reject) => { | |
| // SWG (global): represents an array of handlers that are called back | |
| // with a reference to the Subscriptions API once the library is loaded. | |
| // eslint-disable-next-line no-param-reassign | |
| (context.SWG = context.SWG || []).push((swg) => resolve(swg)); | |
| }); | |
| }; | |
| getWindowSwg().then((swgClient) => { | |
| swgClient.subscribe(sku); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment