From 50e12e1a036bba05b440ec4c416e98af4fb4f88a Mon Sep 17 00:00:00 2001 From: duyhungtnn Date: Wed, 29 Apr 2026 14:36:03 +0700 Subject: [PATCH 1/2] chore: add init/destroy UI and improve example flow Revamp the example app to provide explicit Initialize/Destroy controls and improve logging and lifecycle handling. HTML: add Initialize and Destroy buttons, reorganize layout, and enhance the logs pane styling. TS: add AUTO_INIT_FLAG, stronger typings for button elements, timestamped logs, updateButtons helper, and new handleInit/handleDestroy flows that initialize/destroy the BKT client, register/remove evaluation update listeners, and update UI state. Also improve flush/user-attribute messages, move initialization behind the init handler (with optional auto-init), and ensure cleanup runs on beforeunload. --- example/index.html | 16 +++-- example/index.ts | 143 ++++++++++++++++++++++++--------------------- 2 files changed, 89 insertions(+), 70 deletions(-) diff --git a/example/index.html b/example/index.html index 8b8edb55..ac2f8db3 100644 --- a/example/index.html +++ b/example/index.html @@ -8,11 +8,17 @@
- - - - -
+
+ + +
+
+ + + + +
+