liveBook · Manning

Contract

As explained in Vanilla Web

A specification of an API's operations, inputs, outputs, and behavioral requirements.

An API contract specifies how an API is used and what it does: its operations, inputs, outputs, and behavioral requirements. Clear contracts help people decide whether a micro-library fits and use it safely. section 14.1.8

Document the details users need to rely on:

  • Exact signatures and expected input shapes. section 14.1.8
  • Side effects, return values, and lifecycle rules, including cleanup and asynchronous behavior. section 14.1.8
  • Browser assumptions and feature-detection requirements. section 14.1.8

How Vanilla Web covers it

How deep it goes
Specifies signatures, inputs, side effects, returns, and lifecycle rules without detailing implementation internals.
Examples
Recommends one or two complete usage examples alongside exact API details.
What you can do after
Evaluate a micro-library's fit and use it safely by checking signatures, inputs, side effects, returns, and lifecycle rules.
How it connects
Connects API contracts with README documentation, browser assumptions, cleanup behavior, and asynchronous behavior.

Also explained in

Compare how 58 books explain contract →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vanilla Web. The section links point to the parts of the book it draws on.