# Function: readMetabolicState()

[**lifecycle-kit**](https://jonbogaty.com/lifecycle-kit/api/readme/index.md)

***

[lifecycle-kit](https://jonbogaty.com/lifecycle-kit/api/readme/index.md) / [chem](https://jonbogaty.com/lifecycle-kit/api/chem/readme/index.md) / readMetabolicState


# Function: readMetabolicState() {#function-readmetabolicstate}


> **readMetabolicState**(`raw`): [`MetabolicState`](https://jonbogaty.com/lifecycle-kit/api/chem/interfaces/metabolicstate/index.md)

Defined in: [chem/metabolism.ts:296](https://github.com/jbcom/lifecycle-kit/blob/074e4e7b8038d3e2de9eb44c4b5b5aee0ef02b48/src/chem/metabolism.ts#L296)

Read a metabolic state that was persisted as JSON.

koota traits hold flat values, so the state lives as a string on the
Metabolism trait. A malformed or absent record falls back to a newborn
rather than throwing, so an old save loads into the new system instead of
bricking — and so a caller reading mass never has to handle a parse error
to answer "how big is it".


## Parameters {#parameters}



### raw {#raw}


`string` \| `undefined`


## Returns {#returns}


[`MetabolicState`](https://jonbogaty.com/lifecycle-kit/api/chem/interfaces/metabolicstate/index.md)
