<commit_before># Creating observable data structures and reactions

## Atoms

At some point you might want to have more data structures or other things (like streams) that can be used in reactive computations.
Achieving that is pretty simple by using the `Atom` class.
Atoms can be used to signal MobX that some observable data source has been observed or changed.
And MobX will signal the atom whenever it is used or no longer in use.

The following example demonstrates how you can create an observable `Clock`, which can be used in reactive functions,
and returns the current date-time.
This clock will only actually tick if it is observed by someone.

The complete API of the `Atom` class is demonstrated by this example.

```javascript
import {Atom, autorun} from "mobx";

class Clock {
	atom;
	intervalHandler = null;
	currentDateTime;<commit_msg>Updates refguide/extending.md<commit_after># 创建一个可被观察的数据结构和响应

## Atoms

在某些时候，你可能想要更多的数据结构或者其它可以在reactive计算时使用的东西(例如流)。使用类`Atom`实现这些是非常简单的，Atoms可用于通知MobX当某些被观察的数据结构发生


Achieving that is pretty simple by using the `Atom` class.
Atoms can be used to signal MobX that some observable data source has been observed or changed.
And MobX will signal the atom whenever it is used or no longer in use.

The following example demonstrates how you can create an observable `Clock`, which can be used in reactive functions,
and returns the current date-time.
This clock will only actually tick if it is observed by someone.

The complete API of the `Atom` class is demonstrated by this example.

```javascript
import {Atom, autorun} from "mobx";

class Clock {
	atom;
	intervalHandler = null;
	currentDateTime;
{'fraction_non_alphanumeric': 0.049576783555018135, 'fraction_numerical': 0.0, 'mean_word_length': 4.910714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4700515', 'n_tokens_mistral': 509, 'n_tokens_neox': 497, 'n_words': 237}