Skip to content

v1.0.12

@YidiDev YidiDev tagged this 09 Dec 01:19
This release solves the isLoading bug by providing direct access to the
in-flight request map - the single source of truth for loading state.

New Features:
✨ isItemLoading(typeName, id, level) - Check actual in-flight state
✨ hasAnyInFlightRequests() - Global loading indicator
✨ DevTools enhancement - In-flight request tracking

The Problem:
The isLoading flag could desync with reality when reactive frameworks (Alpine.js,
React, Vue, Svelte) called .it() multiple times during reactive cycles.

The Solution:
Instead of fixing state flag synchronization (which is inherently racy), we
expose the actual source of truth: the in-flight request map (G.inFlightItm).

Usage:
  // ✅ Always accurate - checks actual in-flight map
  get isLoadingAuth() {
    return DL.isItemLoading('me', 'current')
  }

  // ✅ Global loading indicator
  get hasAnyLoading() {
    return DL.hasAnyInFlightRequests()
  }

DevTools:
  DL.devtools().inFlight.totalCount      // Number of active requests
  DL.devtools().inFlight.hasAnyInFlight  // Boolean
  DL.devtools().inFlight.items           // Detailed item requests
  DL.devtools().inFlight.collections     // Detailed collection requests

This is the proper architectural solution: query the source of truth directly
rather than maintaining synchronized derived state.
Assets 2
Loading