chore(i18n,learn): processed translations (#44851)

This commit is contained in:
camperbot
2022-01-21 01:00:18 +05:30
committed by GitHub
parent f866718a3d
commit 5c868af2b8
1696 changed files with 159426 additions and 69 deletions

View File

@@ -0,0 +1,57 @@
---
id: 5a24c314108439a4d403614e
title: アクションクリエイターを定義する
challengeType: 6
forumTopicId: 301441
dashedName: define-an-action-creator
---
# --description--
アクションを作成したら、次のステップとして Redux ストアにアクションを送信し、状態を更新できるようにします。 Redux では、アクションクリエイターを定義してこの処理を実行します。 アクションクリエイターとは、単にアクションを返す JavaScript 関数です。 別の言い方をすれば、アクションクリエイターはアクションイベントを表すオブジェクトを作成します。
# --instructions--
呼び出されたときに `action` オブジェクトを返す `actionCreator()` という関数を定義してください。
# --hints--
関数 `actionCreator` が存在する必要があります。
```js
assert(typeof actionCreator === 'function');
```
`actionCreator` 関数の実行で、`action` オブジェクトを返します。
```js
assert(typeof action === 'object');
```
返される `action` に、値 `LOGIN` を持つキープロパティ `type` を持たせます。
```js
assert(action.type === 'LOGIN');
```
# --seed--
## --seed-contents--
```js
const action = {
type: 'LOGIN'
}
// Define an action creator here:
```
# --solutions--
```js
const action = {
type: 'LOGIN'
}
const actionCreator = () => {
return action;
};
```