mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-10 01:16:39 +02:00
Wrap the client into an event listener in the quickstart doc (#1079)
This commit is contained in:
parent
d22b8503fd
commit
e1df5696cd
@ -46,15 +46,17 @@ const unleash = new UnleashClient({
|
||||
appName: 'my-webapp',
|
||||
});
|
||||
|
||||
unleash.on('synchronized', () => {
|
||||
if (unleash.isEnabled('proxy.demo')) {
|
||||
// do something
|
||||
}
|
||||
});
|
||||
|
||||
// Used to set the context fields, shared with the Unleash Proxy
|
||||
unleash.updateContext({ userId: '1233' });
|
||||
|
||||
// Start the background polling
|
||||
unleash.start();
|
||||
|
||||
if (unleash.isEnabled('proxy.demo')) {
|
||||
// do something
|
||||
}
|
||||
```
|
||||
|
||||
Now you are ready to use the feature toggle you created in your client side application, using the appropriate proxy SDK.
|
||||
|
Loading…
Reference in New Issue
Block a user