async pushPendingAsync() {
        const updates = this._updates;

        if (isEmpty(updates)) return;

        // clear obj state immediately to allow picking up next batch during async operation
        this._updates = {};

        const remoteUpdates = pickBy(updates, (v, k) => !this.isLocalPreference(k)),
            localUpdates = pickBy(updates, (v, k) => this.isLocalPreference(k));

        if (!isEmpty(localUpdates)) {
            XH.localStorageService.apply(this._localStorageKey, localUpdates);
        }

        if (!isEmpty(remoteUpdates)) {
            await XH.fetchJson({
                url: 'xh/setPrefs',
                params: {
                    updates: JSON.stringify(remoteUpdates),
                    clientUsername: XH.getUsername()
                }
            });
        }
    }
/**
     * Push any pending buffered updates to persist newly set values to server or local storage.
     * Called automatically by this app on page unload to avoid dropping changes when e.g. a user
     * changes and option and then immediately hits a (browser) refresh.
     * @returns {Promise}
     */
Push any pending buffered updates to persist newly set values to server or local storage.
Called automatically by this app on page unload to avoid dropping changes when e.g. a user
changes and option and then immediately hits a (browser) refresh.
@returns {Promise}
Push any pending buffered updates to persist newly set values to server or local storage . Called automatically by this app on page unload to avoid dropping changes when e . g . a user changes and option and then immediately hits a ( browser ) refresh . @returns { Promise }
async pushPendingAsync() {
        const updates = this._updates;
        if (isEmpty(updates)) return;
        this._updates = {};
        const remoteUpdates = pickBy(updates, (v, k) => !this.isLocalPreference(k)),
            localUpdates = pickBy(updates, (v, k) => this.isLocalPreference(k));
        if (!isEmpty(localUpdates)) {
            XH.localStorageService.apply(this._localStorageKey, localUpdates);
        }
        if (!isEmpty(remoteUpdates)) {
            await XH.fetchJson({
                url: 'xh/setPrefs',
                params: {
                    updates: JSON.stringify(remoteUpdates),
                    clientUsername: XH.getUsername()
                }
            });
        }
    }
async pushPendingAsync ( ) { const updates = this . _updates ; if ( isEmpty ( updates ) ) return ; this . _updates = { } ; const remoteUpdates = pickBy ( updates , ( v , k ) => ! this . isLocalPreference ( k ) ) , localUpdates = pickBy ( updates , ( v , k ) => this . isLocalPreference ( k ) ) ; if ( ! isEmpty ( localUpdates ) ) { XH . localStorageService . apply ( this . _localStorageKey , localUpdates ) ; } if ( ! isEmpty ( remoteUpdates ) ) { await XH . fetchJson ( { url : 'xh/setPrefs' , params : { updates : JSON . stringify ( remoteUpdates ) , clientUsername : XH . getUsername ( ) } } ) ; } }
Push any pending buffered updates to persist newly set values to server or local storage.
Push any pending buffered updates to persist newly set values to server or local storage .
// clear obj state immediately to allow picking up next batch during async operation