SchizoDuckie / CreateReadUpdateDelete.js

CreateReadUpdateDelete.js aims to bring you a tiny footprint (18kb compressed), platform independent ORM/ActiveRecord implementation for Javascript that works flawlessly on SQLite / WebSQL databases, or any flavor of remote database you can think of via serverside JSON API. Written in Plain Old JavaScript without any framework dependencies, you can use this with Mootools, Jquery, Zepto, Ember, or whatever your drug of choice is.
http://schizoduckie.github.io/CreateReadUpdateDelete.js/
MIT License
38 stars 5 forks source link

Object.observe(CRUD.stats: not working on mobile #10

Closed MarioVanDenEijnde closed 7 years ago

MarioVanDenEijnde commented 8 years ago

Hello SchizoDuckie,

The following code works fine on Chrome but not on the mobile: Any idea where to look for?

        Object.observe(CRUD.stats, function(newValues) {
           progress.innerHTML = Math.floor((CRUD.stats.writesExecuted / CRUD.stats.writesQueued) * 100);
           writesQueued.innerHTML = CRUD.stats.writesQueued;
           writesExecuted.innerHTML = CRUD.stats.writesExecuted; 
            if(CRUD.stats.writesQueued == CRUD.stats.writesExecuted) {
                updateCount();
            }
        });

Kind regards, Mario

SchizoDuckie commented 7 years ago

Object.observe is not available on mobile (and also deprecated).

In a pending release version of CRUD.js i've added getters and setters that allow hooking a callback into the stats process:

image