@@ -199,48 +199,26 @@ <h2>📝 Your Notes</h2>
199199
200200 < div class ="demo-card ">
201201 < h2 > 🖥️ Console Output</ h2 >
202- < div id ="output "> Initializing ObjectQL with LocalStorage ...
202+ < div id ="output "> Initializing ObjectQL with Memory Driver ...
203203</ div >
204204 </ div >
205205 </ div >
206206
207207 < script type ="module ">
208208 import { ObjectQL } from '@objectql/core' ;
209- import { LocalStorageDriver } from '@objectql/driver-localstorage' ;
210209 import { MemoryDriver } from '@objectql/driver-memory' ;
211210
212211 // Global variables
213212 window . app = null ;
214213 window . driver = null ;
215214 window . noteRepo = null ;
216- window . currentDriverType = 'localstorage' ; // Default
217-
218- window . switchDriver = async function ( type ) {
219- if ( type === window . currentDriverType ) return ;
220- if ( ! confirm ( 'Switching drivers will reload the app. Continue?' ) ) {
221- document . getElementById ( 'driverSelect' ) . value = window . currentDriverType ;
222- return ;
223- }
224- window . currentDriverType = type ;
225- document . getElementById ( 'noteList' ) . innerHTML = '' ;
226- document . getElementById ( 'output' ) . textContent = '' ;
227- await initObjectQL ( ) ;
228- }
229215
230216 async function initObjectQL ( ) {
231217 try {
232- if ( window . currentDriverType === 'localstorage' ) {
233- log ( '💾 Creating LocalStorage Driver...' ) ;
234- window . driver = new LocalStorageDriver ( {
235- namespace : 'objectql-notes-demo' ,
236- strictMode : true
237- } ) ;
238- } else {
239- log ( '🧠 Creating Memory Driver...' ) ;
240- window . driver = new MemoryDriver ( ) ;
241- }
218+ log ( '🧠 Creating Memory Driver...' ) ;
219+ window . driver = new MemoryDriver ( ) ;
242220
243- log ( ` 🚀 Initializing ObjectQL with ${ window . currentDriverType } ...` ) ;
221+ log ( ' 🚀 Initializing ObjectQL with Memory Driver...' ) ;
244222
245223 window . app = new ObjectQL ( {
246224 datasources : { default : window . driver }
@@ -262,16 +240,16 @@ <h2>🖥️ Console Output</h2>
262240 } ) ;
263241
264242 await window . app . init ( ) ;
265- log ( '✅ ObjectQL initialized with LocalStorage !' ) ;
243+ log ( '✅ ObjectQL initialized with Memory Driver !' ) ;
266244
267245 const ctx = window . app . createContext ( { isSystem : true } ) ;
268246 window . noteRepo = ctx . object ( 'notes' ) ;
269247
270- // Load existing notes from LocalStorage
248+ // Load existing notes
271249 await loadNotes ( ) ;
272250 updateStorageCount ( ) ;
273251
274- log ( '🎉 Ready! Your data persists across page refreshes .' ) ;
252+ log ( '🎉 Ready! Add notes using the form above .' ) ;
275253
276254 } catch ( error ) {
277255 log ( '❌ Error:' , error ) ;
@@ -291,7 +269,7 @@ <h2>🖥️ Console Output</h2>
291269 log ( `➕ Creating note: "${ content } "` ) ;
292270 const note = await window . noteRepo . create ( { content } ) ;
293271
294- log ( '✅ Note created and saved to LocalStorage ' ) ;
272+ log ( '✅ Note created' ) ;
295273 document . getElementById ( 'noteContent' ) . value = '' ;
296274
297275 await loadNotes ( ) ;
@@ -306,7 +284,7 @@ <h2>🖥️ Console Output</h2>
306284 window . loadNotes = async function ( ) {
307285 try {
308286 const notes = await window . noteRepo . find ( { } ) ;
309- log ( `📋 Loaded ${ notes . length } notes from LocalStorage ` ) ;
287+ log ( `📋 Loaded ${ notes . length } notes` ) ;
310288
311289 displayNotes ( notes ) ;
312290 updateStorageCount ( ) ;
@@ -345,7 +323,7 @@ <h2>🖥️ Console Output</h2>
345323 try {
346324 log ( `🗑 Deleting note ${ id } ...` ) ;
347325 await window . noteRepo . delete ( id ) ;
348- log ( '✅ Note deleted from LocalStorage ' ) ;
326+ log ( '✅ Note deleted' ) ;
349327
350328 await loadNotes ( ) ;
351329 updateStorageCount ( ) ;
@@ -361,7 +339,7 @@ <h2>🖥️ Console Output</h2>
361339 }
362340
363341 try {
364- log ( '🗑 Clearing all data from LocalStorage ...' ) ;
342+ log ( '🗑 Clearing all data...' ) ;
365343 await window . driver . clear ( ) ;
366344 log ( '✅ All data cleared' ) ;
367345
0 commit comments