# `Writer.state`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Method of [`Writer`](Writer.md) · inherited by [`Tx`](Tx.md), [`Session`](Session.md), [`testing.FakeSession`](testing.FakeSession.md) · stable · since 2.0.0 · called as `session.state`

```ts
state(): SessionState;
```

Read class: intent. Recorded state and the look, staged writes and write-queue writes included.
Sync. A target with a write queued behind an open transaction reads unspecified (old or queued
value): await that write first. Intent is not what is shown: for what the viewer shows, keep
the payloads of the latest state events ('scene-model:changed' for the model), which fire
after the frame that shows their commit.
Errors: none.

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `state` names no product |
| 2. A precedent | pass: [Unity Undo.RecordObject](https://docs.unity3d.com/ScriptReference/Undo.RecordObject.html) (row `X6`) |
| 3. Two apps, or labs | pass: 18 apps (ledger: app-37356bf09f, app-4f16d2f6da, app-4fd23bc869, app-822bb9d6aa, app-8675b3225c, app-bcb7ef21da, app-c1384707fc, app-ddfb017681 and 10 more) |
| 4. The cheaper fix first | decided per need in Appendix B: rows `X6` at tier stable (a member only where no rule, data, asset or app code serves the need) |
