---title: 'subscribeKey'section: 'API'subSection: 'Utils'description: ''---
# subscribeKey
To subscribe to a primitive value in proxy state, consider `subscribeKey`.
```jsimport { subscribeKey } from 'valtio/utils'
const state = proxy({ count: 0, text: 'hello' })subscribeKey(state, 'count', (v) => console.log('state.count has changed to', v))```
## Codesandbox demo
https://codesandbox.io/s/dynamic-ui-with-valtio-9gme46?file=/src/ComplexCounter.tsx