data-client

Async State Management without the Management

APACHE-2.0 License

Downloads
44.4K
Stars
1.9K
Committers
37

Bot releases are visible (Hide)

data-client - @data-client/[email protected] Latest Release

Published by github-actions[bot] 2 months ago

Patch Changes

  • c263931 Thanks @ntucker! - Update README

  • 366c609 Thanks @ntucker! - Make NetworkError messages include more useful information

    Add URL so it's clear what is causing issues when response is
    not 'ok'

data-client - @data-client/[email protected]

Published by github-actions[bot] 2 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • aa4dac5 Thanks @ntucker! - useCache() logic simplification (no real change)

  • 0fac3ce Thanks @ntucker! - useDLE() deps list more specific to avoid extraneous re-computation

  • 8f827cf Thanks @ntucker! - Don't refetch if controller changes (should never happen)

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3165 3fa9eb9 Thanks @ntucker! - Query can take Object Schemas

    This enables joining arbitrary objects (whose pk works with the same arguments.)

    class Ticker extends Entity {
      product_id = '';
      price = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    class Stats extends Entity {
      product_id = '';
      last = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    const queryPrice = new schema.Query(
      { ticker: Ticker, stats: Stats },
      ({ ticker, stats }) => ticker?.price ?? stats?.last,
    );
    
  • Updated dependencies [3fa9eb9]:

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3165 3fa9eb9 Thanks @ntucker! - Query can take Object Schemas

    This enables joining arbitrary objects (whose pk works with the same arguments.)

    class Ticker extends Entity {
      product_id = '';
      price = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    class Stats extends Entity {
      product_id = '';
      last = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    const queryPrice = new schema.Query(
      { ticker: Ticker, stats: Stats },
      ({ ticker, stats }) => ticker?.price ?? stats?.last,
    );
    
  • Updated dependencies [3fa9eb9]:

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3165 3fa9eb9 Thanks @ntucker! - Query can take Object Schemas

    This enables joining arbitrary objects (whose pk works with the same arguments.)

    class Ticker extends Entity {
      product_id = '';
      price = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    class Stats extends Entity {
      product_id = '';
      last = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    const queryPrice = new schema.Query(
      { ticker: Ticker, stats: Stats },
      ({ ticker, stats }) => ticker?.price ?? stats?.last,
    );
    
data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3165 3fa9eb9 Thanks @ntucker! - Query can take Object Schemas

    This enables joining arbitrary objects (whose pk works with the same arguments.)

    class Ticker extends Entity {
      product_id = '';
      price = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    class Stats extends Entity {
      product_id = '';
      last = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    const queryPrice = new schema.Query(
      { ticker: Ticker, stats: Stats },
      ({ ticker, stats }) => ticker?.price ?? stats?.last,
    );
    
  • Updated dependencies [3fa9eb9]:

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3165 3fa9eb9 Thanks @ntucker! - Query can take Object Schemas

    This enables joining arbitrary objects (whose pk works with the same arguments.)

    class Ticker extends Entity {
      product_id = '';
      price = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    class Stats extends Entity {
      product_id = '';
      last = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    const queryPrice = new schema.Query(
      { ticker: Ticker, stats: Stats },
      ({ ticker, stats }) => ticker?.price ?? stats?.last,
    );
    
data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3165 3fa9eb9 Thanks @ntucker! - Query can take Object Schemas

    This enables joining arbitrary objects (whose pk works with the same arguments.)

    class Ticker extends Entity {
      product_id = '';
      price = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    class Stats extends Entity {
      product_id = '';
      last = 0;
    
      pk(): string {
        return this.product_id;
      }
    }
    const queryPrice = new schema.Query(
      { ticker: Ticker, stats: Stats },
      ({ ticker, stats }) => ticker?.price ?? stats?.last,
    );
    
  • Updated dependencies [3fa9eb9]:

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3164 ffea6fc Thanks @ntucker! - Manager.getMiddleware() -> Manager.middleware

    getMiddleware() is still supported to make this change non-breaking

  • 82fbb85 Thanks @ntucker! - Middleware types include union of possible actions

  • 262587c Thanks @ntucker! - Add SchemaClass type export

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3161 b932dca Thanks @ntucker! - Add jsdocs to IdlingNetworkManager

  • e4751d9 Thanks @ntucker! - NetworkManager constructor uses keyword args

    Before

    new NetworkManager(42, 7);
    

    After

    new NetworkManager({ dataExpiryLength: 42, errorExpiryLength: 7 });
    
  • 0adad92 Thanks @ntucker! - Update debugging link

  • 09ad848 Thanks @ntucker! - state.endpoints moved above indexes

    entites and endpoints are the most commonly inspected
    parts of state when debugging, so it is better to have endpoints
    above indexes.

  • #3161 b932dca Thanks @ntucker! - Add configuration to getDefaultManagers()

    // completely remove DevToolsManager
    const managers = getDefaultManagers({ devToolsManager: null });
    
    // easier configuration
    const managers = getDefaultManagers({
      devToolsManager: {
        // double latency to help with high frequency updates
        latency: 1000,
        // skip websocket updates as these are too spammy
        predicate: (state, action) =>
          action.type !== actionTypes.SET_TYPE || action.schema !== Ticker,
      },
    });
    
    // passing instance allows us to use custom classes as well
    const managers = getDefaultManagers({
      networkManager: new CustomNetworkManager(),
    });
    
  • Updated dependencies [b932dca, e4751d9, 09ad848]:

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

data-client - @data-client/[email protected]

Published by github-actions[bot] 3 months ago

Patch Changes

  • #3161 b932dca Thanks @ntucker! - Add jsdocs to IdlingNetworkManager

  • e4751d9 Thanks @ntucker! - NetworkManager constructor uses keyword args

    Before

    new NetworkManager(42, 7);
    

    After

    new NetworkManager({ dataExpiryLength: 42, errorExpiryLength: 7 });
    
  • 09ad848 Thanks @ntucker! - state.endpoints moved above indexes

    entites and endpoints are the most commonly inspected
    parts of state when debugging, so it is better to have endpoints
    above indexes.