1.8 KiB
1.8 KiB
id | title | challengeType | isRequired | videoUrl | localeTitle |
---|---|---|---|---|---|
5a24c314108439a4d403614d | Define a Redux Action | 6 | false | 定义Redux动作 |
Description
type
属性,该属性指定发生的操作的“类型”。将Redux操作视为信使,将有关应用程序中发生的事件的信息提供给Redux商店。然后,商店根据发生的操作开展更新状态的业务。 Instructions
action
并为其设置一个属性type
设置为字符串'LOGIN'
。 Tests
tests:
- text: 应该存在一个操作对象。
testString: 'assert((function() { return typeof action === "object" })(), "An action object should exist.");'
- text: 该操作应具有值为<code>LOGIN</code>的键属性类型。
testString: 'assert((function() { return action.type === "LOGIN" })(), "The action should have a key property type with value <code>LOGIN</code>.");'
Challenge Seed
// Define an action here:
Solution
// solution required