Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.67 KB

File metadata and controls

48 lines (37 loc) · 1.67 KB

CountQueuingStrategyOptions

Namespace: SpawnDev.SpawnJS.JSObjects
Source: JSObjects/CountQueuingStrategyOptions.cs
MDN Reference: CountQueuingStrategyOptions on MDN

https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/CountQueuingStrategy#options

Properties

Property Type Access Description
CountQueuingStrategyOptions class get https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/CountQueuingStrategy#options

Examples

SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:

  • Properties and methods use PascalCase (e.g., readyState becomes ReadyState)
  • Events use ActionEvent with +=/-= (e.g., addEventListener("click", fn) becomes OnClick += handler)
  • Async methods return Task<T> instead of Promise<T>
  • Objects should be disposed with using statements
  • Access via JS.Get<CountQueuingStrategyOptions>(...) or constructor new CountQueuingStrategyOptions(...)
const queuingStrategy = new CountQueuingStrategy({ highWaterMark: 1 });

const writableStream = new WritableStream(
  {
    // Implement the sink
    write(chunk) {
      // …
    },
    close() {
      // …
    },
    abort(err) {
      console.log("Sink error:", err);
    },
  },
  queuingStrategy,
);

const size = queuingStrategy.size();

See full example on MDN