207 Matching Annotations
  1. Mar 2024
    1. The module to import from. The evaluation of the specifier is host-specified, but always follows the same algorithm as static import declarations.

      Only single quoted and double quoted Strings are allowed 好象只允许字串?!

  2. Feb 2024
    1. The following elements offer the option of expressing coordinate values and lengths as fractions (and, in some cases, percentages) of the object bounding box, by setting a specified attribute to 'objectBoundingBox' on the given element:

      这个规范导至渐变色在绝对横线或竖线中不会显示 。

  3. Nov 2023
  4. Oct 2023
  5. Jul 2023
    1. We use a private IPFS network to handle storage.


  6. May 2023
    1. This module has been primary written for Node.js. It does depend on Buffer. There is browser friendly buffer module available, but you depend on your framework how easy that is to fit it in. There is not much more we can do, as these core dependencies are not shared between browser and Node.js.


  7. Mar 2023
    1. 16.04 (LTS) 6.0 None 6.0, 5.0, 3.1, 3.0, 2.2, 2.1, 2.0


  8. Jan 2023
    1. The basic point for a winning hand without Fan (doubles) is 1 point


  9. Dec 2022
    1. All names in X3D must start with letter, followed by letters, numbers and the underscore ("_"). Hyphens ("-") are forbidden like in most programming languages.


  10. Sep 2022
    1. It is best to make your prompt as legible and readable as possible. When in doubt, think of it like you’re talking to a human as it is trained from image captions pairs written by humans! No one (honestly willing to bet even including the developers) knows the full extent of how it processes prompts down to a T, but here’s a general protocol that I and others have found to work quite well.


  11. Jul 2022
  12. Apr 2022
  13. Mar 2022
    1. SketchBook 已从 Autodesk 中分离出来,成为一家独立公司。您可以继续使用现有版本的 Autodesk SketchBook,但 Autodesk 将不再提供先前版本的更新,也不支持重新安装先前版本。


  14. Jan 2022
    1. 天干中奇数位的“甲丙戊庚壬”为阳干,偶数位的“乙丁己辛癸”为阴干,乾坤是阴阳的始终,因此以代表奇数始终的“甲壬”配乾,代表偶数始终的“乙癸”配坤,庚阳配震,辛阴配巽,戊阳配坎,己阴配离,丙阳配艮,丁阴配兑。


    1. ut over time the community and the JavaScript specification has converged on a format called ES Modules (or ES6 modules). You might know it as the import/export syntax.

      模块逐渐使用ES Modules(ES6模块)

    1. 在颜色为青、绿、碧色。


    1. 指立秋起至秋分前


    2. 古人将从立秋起至秋分前这段日子称之为“长夏”。


    3. 五季对应时间:春季2月4日至5月4日,夏季5月5日至7月6日,长夏7月7日至8月6日,秋季8月7日至11月6日,冬季11月7日至次年2月3日。


    4. 五季对应时间:春季2月13日至4月25日,夏季5月14日至7月28日,秋季8月16日至10月28日,冬季11月16日至次年1月25日,长夏1月26日至2月12日、4月26日至5月13日、7月29日至8月15日、10月29日至11月15日。


    5. 《内经·素问·太阴阳明论》:“脾者土也,治中央,常以四时长四藏,各十八日寄治。”就是说脾主长夏,既每季的最后18天。


    1. The CAI has many efforts on the horizon to create user-facing tools for collecting and attaching CAI metadata to content. One way to attach CAI metadata is through the Adobe Photoshop feature called Content Credentials (Beta). The feature is in ongoing development and is one of many ways content authenticity efforts are being brought to life. If you are interested in signing up for news and updates about CAI tools, please subscribe to our mailing list.


    2. Our system doesn’t prevent anyone from taking a screenshot of an image, but we will indicate when we don’t have historical data for a file. If someone uses a screenshot in CAI-enabled tools, we wouldn’t include CAI metadata from the original file since there wouldn’t be any metadata retained.



    3. CAI is not enforcing digital rights management considerations around metadata. So, it's possible for individuals or applications to strip CAI data from an image, in which case fingerprinting techniques can be employed to re-attach CAI data.


    4. Right now, a piece of content’s CAI data is stored locally within the file itself. Users will soon be able to choose whether they want to store the data by embedding it within the file, or store it in the cloud to avoid unnecessary file weight and optimize for recoverability.


    5. then judge for themselves how authentic that image is


    1. 内容凭据(测试版)当前仅提供英语版本。非英语用户仍可以访问英语版本的功能。


  15. Sep 2021
    1. I probably won’t be updating older articles using <use xlink:href="" /> unless something bizarre happens and some browser actually does pull support.

      是啊,也许有些应用,例如inkscape,例如svgedit 今天已经2021年9月了,它们依旧只支持xlink:href 而不支持href,这就是麻烦所在!

    1. Note: SVG 2 removed the need for the xlink namespace, so instead of xlink:href you should use href.


    1. SVG <use> elements don’t currently have any way to ask for cross-origin permissions. They just don’t work cross-origin, at all.


  16. Aug 2021
    1. WHATWG取得HTML和DOM的控制权,W3C遵循

    2. W3C agrees to discontinue its release plans for W3C versions of HTML 5.3 and DOM 4.1


    1. A quick alternative I tried, I am able to use npm-watch to simulate a 'hot-reload' by retriggering docfx build --serve when the file changes. Incase this will be useful for someone.


    1. Section definition



    1. A section definition works but it's kinda unwieldy - you have to add a > before every line. In the end I just added a plugin to do some post processing. I'll close this issue out as I found a workaround.


    2. Add a blank line after <div class="foo" id="foobar">. That will end the HTML block; see CommonMark section 4.6 HTML blocks, item 6, and example 122. You may need a blank line after </div>, as well.


    3. Yup, I understand that. However you cannot use markdown syntax inside html. That's part of what I want to be able to do


    1. a numeric field right of the name: this is the amount of this nonlinear transformation.


    2. But it has turned out that there are some categories of nonlinear transformations which are well understood. You can restrict the selection of nonlinear transformations by using these categories. Each nonlinear transformation can have one or more of the following categories


    3. Currently, there are about 800 nonlinear transformations included in JWildfire.


    4. So, a good way of thinking about nonlinear transforms is that they add small details to otherwise more "straight" transformations like a rotation.


    5. Please note that there is no transformation order. Swapping the positions of two transforms would not change the fractal, hence there are no buttons to change the positions of the transformation inside the table.


  17. Jul 2021
    1. 16.3. Are 4k renders possible? Yes. You can literally render in any resolution, also 8k: by rendering a single image at once. The maximum render size is limited only by your available memory. (For really huge images, you may need patience too.) by using the Quilt-renderer-module you may render really huge images in smaller parts, which are then assembled together. The maximum render size is also limited by memory. But often, you will get other problems before reaching the memory limit in JWildfire. For example, some image files can be very big (I have tested with sizes up to 1 GB), and it is hard to find software that can process such large images.


    2. It is beyond the scope of this book to explain exactly how transformations work and how fractal flames are generated in general. If you are interested in the math behind fractal flames, a very good resource is the dissertation by Scott Draves, the inventor of the fractal flame itself: https://flam3.com/flame_draves.pdf Many of the actions described here are very intuitive to use, and allow you to create fractal artwork without knowing all of the processes involved (which are not too intuitive from an artist’s view.) Besides this users manual, I’m planning to write another book which will bring the two worlds of theory and practice together. I realize this will not happen right away, but sometime in the future.

      理论方面超出本手册的范围了。 作者说,在将来也许会写一本理论和实践相结合的书。 不过我觉得很难等到。

    1. 小米11 Ultra是目前小米旗下最好的高端旗舰机,也是当前手机市场7000以内最出色的旗舰机,其实力完全可以抗衡上万元的顶级旗舰。顶级性能、顶级屏幕、顶级拍照、顶级录像、超大容量电池、最新的机身材质等各种能堆的配置都堆了个遍,硬件参数上可以说做到了毫无短板,甚至手机市场没有一款机型的硬件配置可以与之抗衡。在外观设计上,小米11 Ultra同样博得满堂彩,超高辨识度、个性张扬的外观设计,以及陶瓷工艺,使得这款机型高端感很强,回头率很高。不过要注意,不太建议选购大理石特别版,因为情商高可以说是大理石,情商低可以说是地砖,加上了大理石纹理反而降低了质感,不如黑、白纯色版本高级。如果你想要最好的小米手机,或者想要7000以内综合性价比最高的手机,那么小米11 Ultra毫无疑问是最佳选择。不过目前由于高通骁龙888处理器的发热大功耗高、MIUI 12.5系统的优化适配不到位,实际体验有待提高。


    1. 1# 回复 举报 风达 发表于 2012-3-20 23:11:44


    1. It is that time when you can post your thoughts or ideas about new Apophysis. Yes, it is under its way Be warned though, the new major version number is not for nothing... Apophysis 3 will be a huge step forward.The most important thing is it will support layers. Every layer can be a flame, a background, a time-escaped fractal... and probably other types, too. A single design can have as many layers, as you can create.Isn't it fascinating? It's also one and the only moment when we can get rid of Delphi and scripting library - finally! It's in C++ with Qt4,which means it's portable and relatively easy for other coders to mess with it as they like.The main design is ready, skeleton code is up and running - now I need YOUR thoughts. Note I can't get all of them into


    1. 小米11Ultra这边搭载的是高通最新的旗舰机芯片骁龙888,同样采用的是5nm的工艺,性能来说绝对是目前除了苹果A14芯片以外的最强,在跑分上也是遥遥领先于华为的麒麟9000,只不过“火龙888”的这个称号是它的一个致命短板,整体的使用体验上来说,还是麒麟9000的华为要更胜一筹。


    1. 奇门遁甲盘中有九个宫位,我们在实际运用中只看八个宫位,中间的宫我们是不看的,奇门软件上,中宫也是空白一片,不包含任何的信息。八卦有八个,八神有八个,八门有八个,只有星是九个,中宫是天禽星。


  18. Jun 2021
    1. In preparation for the upcoming mainnet release, the network ID of the testnet has been changed from 1 to 10.

      根据https://chainid.network/ id1为以太坊,10为Oeth,而100才是XDai!这10是怎么回事?

    1. All Bee v1.0 versions are incompatible with the v0.6 Swarm. Node operators who currently run nodes on the Swarm test network should not update to this version. This version is currently only rolled-out to the Swarm mainnet, to which node operators can operate fully-functional nodes when the BZZ token is circulating (after June 21st).


    1. 而截至目前,Swarm已完成4200万元私募融资,V神在VHSG线上交流会上表示“近期,以太坊基金会将投入3000万美金用于协助Swarm底层技术升级”。




    1. We are searching for a possibility to render HDRP projects with alpha. The current alpha channel is a grayscale interpretation of the full image an not a real alpha channel. So we are also searching for a solution for this.

      是不是在HDRP或URP下面根本就不能透明? 所以选项也取消了。

    1. Unity Recorder Transparent Background Tutorial


    1. This property is not available when the selected Media File Format doesn't support transparency, or when Capture is set to Game View.


    1. means they can be dragged and dropped into fields in the Inspector, or picked using the Object Picker next to an Object field.


  19. May 2021
    1. I had another Newtonsoft JSON package installed from https://github.com/jilleJr/Newtonsoft.Json-for-Unity and started to get the "Multiple precompiled assemblies with the same name Newtonsoft.Json.dll" error when compiling. If you look in "Library > PackageCache" you will most likely see a folder called "com.unity.nuget.newtonsoft-json@1.1.2" or something similar. Inside that folder is a README.md which I looked at. It had instructions for using the package. I replaced my jilleJr package in the manifest.json with "com.unity.nuget.newtonsoft-json": "2.0.0-preview" and everything is compiling again. It appears that Unity is now including Newtonsoft JSON in certain cases.


  20. Apr 2021
    1. In Unity 2020.1 and later versions, these preview packages won’t be listed in the Package Manager.


    1. t's almost like there are two separate factions within Unity, with one running this skunkworks DOTS project. The other is completely disinterested in this work being completed. Worrisome signs for ECS: - Removed from package manager - Did not get verified in 2020 - Is not on the official 2021 priority list - The items on the priority list are very much focusing on the GameObject workflow, even though DOTS versions were announced earlier.


    1. 密码子一般只编码20种,稀有氨基酸一般是在常见氨基酸的基础上修饰来的。


    1. Códice Software is the name of the company behind Plastic SCM, our flagship version control product. Códice has been acquired by Unity Technologies in August 2020.


    1. USDT已经在三条公链上发行了,分别是Omni-USDT,基于以太坊(Ethereum)的ERC-USDT,和基于波场(Tron)的TRC-USDT。


  21. Mar 2021
    1. As the context above shows, the value of a term definition can either be a simple string, mapping the term to an IRI, or a map.


    1. This version will only be compatible with 2020.2 and 2021.1. Starting from 2021.2, new features will strictly be available from the core product, and won’t be supported by the packages.

      在2021.1.0b8里面已经没有UI菜单了。而是在Windows菜单里多了UI Toolkit项目。

  22. Feb 2021
    1. So your answer is no. there might be a support for c++ (the source code indicates so) but no support for C#.


    1. As a newcomer to JS in general myself, I would encourage you to stick with Observable for a time. Observable’s helped me to understand how pieces of a script play together… to be able to see more clearly which elements can be separated out, which must stay together, etc. Hopefully you’ll also find that your knowledge of D3 will improve more rapidly by tinkering with it in Observable.


    2. 本页已经总结,见页面底部说明。 D3有很多资料,有些导到Observable,要重新设计主页。 D3肯定要用Observable作为它他的示例所在地。 有几个办法可以将D3从Observalble中拿出来。

    3. Copy-pasting code can mean very different things in different situations. I believe the source of frustration for many here is the desire to bring unfamiliar code into a familiar environment and tinker with it there. To that end, several community members have provided tutorials and examples for doing just that: Convert observable code to normal Javascript / David B. / Observable 3 Observable vs Regular Flavor Javascript / Carlos Sandoval Olascoaga / Observable 3 Learning from D3 in Action - in Observable / Tom MacWright / Observable


    4. I can wholeheartedly say that Observable is a better way to do it. We will absolutely not stop anyone from translating or making examples elsewhere, however we want to make it clear that bl.ocks.org 1 will continue in maintenance mode but will not be updated.

      澄清D3示例: 确定Observable是更好的办法,bl.ocks.or将不再更新。

    1. 这款软件现在没有电脑版因此必须借助安卓模拟器才可以在电脑上运行。


  23. Jan 2021
  24. Dec 2020
    1. 不可变引用 r1 和 r2 的作用域在 println! 最后一次使用之后结束


    1. 当持有堆中数据值的变量离开作用域时,其值将通过 drop 被清理掉,除非数据被移动为另一个变量所有


    1. We're pushing this data live as we process it, and will complete everything by early January.


    1. For the time being, if you need 3D UI for your project, our recommendation is to use UGUI, which we're making sure will work well alongside UI Toolkit.

      3D UI 还是建议 UGUI,可以跟UI Toolkit一起使用。

    2. We're still committed at maintaining that technology as long as necessary for users to transition to UI Toolkit.

      从Unity UI 转到 UI Toolkit

    1. pub struct Header<Number: Copy + Into<U256> + TryFrom<U256>, Hash: HashT> { /// The parent hash. pub parent_hash: Hash::Output, /// The block number. #[cfg_attr(feature = "std", serde( serialize_with = "serialize_number", deserialize_with = "deserialize_number"))] pub number: Number, /// The state trie merkle root pub state_root: Hash::Output, /// The merkle root of the extrinsics. pub extrinsics_root: Hash::Output, /// A chain-specific digest of data useful for light clients or referencing auxiliary data. pub digest: Digest<Hash::Output>, }

      substrate header 结构

  25. Nov 2020
    1. The starting price which is the minimum value is fixed at $1 (10 OVRTokens) with a 100% increment on the last bid value for every following bid.


    1. A full node can rebuild the entire chain with no additional input from other nodes and become an archive node.


  26. Oct 2020
    1. for later resale


  27. Sep 2020
    1. 另外,wallet.io将钱包成员加密后的私钥分别存储于香港,日本,新加坡等地区服务器,通过物理隔离确保资产安全。

    1. 这里的算法还是以手续费为0.2%计算!!而不是更新后的0.3%计算!

    1. 密码只用于直接输入,不存储、不传输,不存在于其它任何地方


  28. Jun 2020
    1. ASP.NET Core Identity for authenticating and storing users is combined with IdentityServer for implementing Open ID Connect.


    1. An object, on the other hand, refers to a block that follows the Merkle DAG protobuf data format.

      object是遵循Merkle DAG protofbuf 数据格式的block

    1. This client library implements the IPFS Core API enabling applications to change between an embedded js-ipfs node and any remote IPFS node without having to change the code. In addition, this client library implements a set of utility functions.

      实现了IPFS Core API,以及一些应用函数。

  29. May 2020
    1. 但浏览器并没有小程序规范的组件与 API 可供使用,例如我们不能在浏览器上使用小程序的 view 组件和 getSystemInfo API。因此我们需要在 H5 端实现一套基于小程序规范的组件库和 API 库。
    1. 移植相对简单,将数据拷过去就差不多了。不过要注意如果原备份还运行的话Pear ID一样会有问题的。

    1. The actions that you take only affect your own IPFS node, not nodes belonging to your peers.


    2. the multicodec prefix in an IPFS CID will always be an IPLD codec.

      IPFS CID 总是使用IPLD codec

    3. Multiformats CIDs are future-proof because they use multihash to support multiple hashing algorithms rather than relying on a specific one.


    4. IPFS uses sha2-256 by default, though a CID supports virtually any strong cryptographic hash algorithm.


    1. const cid = results[0].hash


    1. Both the js-ipfs and js-ipfs-http-client libraries work in browsers, but each has some special considerations noted in their READMEs.


    2. js-ipfs-http-client is a smaller library that controls an IPFS node that is already running via its HTTP API. js-ipfs actually uses this library internally if it detects that another node is already running on your computer


    3. Whenever reasonable, we recommend the second method (interacting with a separate IPFS node via the HTTP API). Keeping the IPFS node in a separate process (even if it’s one your program spawns) isolates you from any stability problems with the node.

      建议使用独立节点,然后使用Http api。

    1. If your OWNER permission’s private key is exposed, you lose access permanently to your EOS account and its funds. There is no way back from this scenario.


    2. Keep the ACTIVE permission key in Scatter and use that for everything you can. Keep the OWNER permission key somewhere safe


    1. The core IPFS team maintain implementations in Golang and Javascript. Those are commonly referred to as go-ipfs and js-ipfs. The official binaries are built from the Go implementation.

      IPFS主要的实现有 go-ipfs 和 js-ipfs。官方二进制包使用go实现。

    1. 恢复初始设置后,设置不会自动保存。


    1. Python 中的变量赋值不需要类型声明。 每个变量在内存中创建,都包括变量的标识,名称和数据这些信息。 每个变量在使用前都必须赋值,变量赋值以后该变量才会被创建。 等号(=)用来给变量赋值。 等号(=)运算符左边是一个变量名,等号(=)运算符右边是存储在变量中的值。


    1. 像if、while、def和class这样的复合语句,首行以关键字开始,以冒号( : )结束,该行之后的一行或多行代码构成代码组。 我们将首行及后面的代码组称为一个子句(clause)。


    2. Python语句中一般以新行作为语句的结束符。 但是我们可以使用斜杠( \)将一行的语句分为多行显示,如下所示:


    3. 在 Python 里,标识符由字母、数字、下划线组成。 在 Python 中,所有标识符可以包括英文、数字以及下划线(_),但不能以数字开头。 Python 中的标识符是区分大小写的。 以下划线开头的标识符是有特殊意义的。以单下划线开头 _foo 的代表不能直接访问的类属性,需通过类提供的接口进行访问,不能用 from xxx import * 而导入。 以双下划线开头的 __foo 代表类的私有成员,以双下划线开头和结尾的 __foo__ 代表 Python 里特殊方法专用的标识,如 __init__() 代表类的构造函数


    1. 悉尼立体模型用google map看的时候要拉近等些时间才会出现。使用工具从google地图中提取数据。通过blender读出抓到的rdc格式文件。

    1. 驱使着樋口优克服这些困难,并不断持着续开发的真正理由是什么呢——“因为兴趣。”


  30. Apr 2020
    1. 200 megabytes is not that bad. I’ve seen it rise above 700 MB easily.


    2. end up with 19k dependencies by installing just one


    1. In the above code, we:state, that the FunctionType extends  (args: any) => anywe say that the FunctionReturnType is a conditional typeinside we declare the ReturnType and assign it with the return type of our function () => infer ReturnType results in assigning the return type to the ReturnType variablewe check if FunctionType extends  (...args: any) => infer ReturnTypeif the above condition is not met, we assign  any to FunctionReturnTypesince the above condition is always met, we assign the ReturnType to the FunctionReturnTypeBy doing all of the above, we can extract the return type of any function.


    2. Introducing the infer keyword

      介绍 infer关键字,待细究

    1. The most commonly used type parameter names are:E – Element (used extensively by the Java Collections Framework)K – KeyN – NumberT – TypeV – ValueS,U,V etc. – 2nd, 3rd, 4th types


    2. we can put a constraint on the T type variable.


    1. From TypeScript 3.7 and onwards, you can use optional chaining to simplify working with nullable types.


    1. Within the extends clause of a conditional type, it is now possible to have infer declarations that introduce a type variable to be inferred. Such inferred type variables may be referenced in the true branch of the conditional type. It is possible to have multiple infer locations for the same type variable.


    1. 对象属性的命名规则 通过[]操作符为对象添加属性时,属性名称可以是任何字符串(包括只包含空格的字符串和空字符串); 通过.操作符为对象添加属性时,属性名称必须是合法的标识符名称; 如果属性名包含非法的标识符字符,则只能采用obj[“propertyName”]的形式; 如果属性名是合法的标识符,读取时即可以采用obj.propertyName,也可以采用obj[“propertyName”]的形式;


    1. An ambient declaration introduces a variable into a TypeScriptscope, but has zero impact on the emitted JavaScript program.




    1. In addition to these development tool middleware, it also adds redux-thunk by default, since thunks are the basic recommended side effects middleware for Redux.

      redux-thunk 默认加入

    1. I'm a Redux maintainer and creator of Redux Toolkit. FWIW, nothing about making async calls with Redux changes with Redux Toolkit. You'd still use an async middleware (typically redux-thunk), fetch data, and dispatch actions with the results.

      Redux Toolkit作者说了,RTK并没有改变任何异步操作的调用。还是可以使用中间件(象redux-thunk)获取数据和分发结果动作。

    1. Taro 的组件编译后就是小程序的自定义组件,而小程序的自定义组件的初始化时是可以指定 data 来让组件拥有初始化数据的。开发者一般会在组件的 constructor 中设置一些初始化的 state,同时也可能会在 render 中处理 state 与 props 产生新的数据,在 Taro 中多出的这一次提前调用,就是为了收集组件的初始化数据,给自定义组件提前生成 data ,以保证组件初始化时能带有数据,让组件初次渲染正常。


    1. For example, noImplicitAny is a recommended option that triggers the compiler to error on expressions and declarations with an implied any type


  31. redux.js.org redux.js.org
    1. reducer: any function with the signature (state, action) -> newState (ie, any function that could be used as an argument to Array.prototype.reduce)root reducer: the reducer function that is actually passed as the first argument to createStore. This is the only part of the reducer logic that must have the (state, action) -> newState signature.slice reducer: a reducer that is being used to handle updates to one specific slice of the state tree, usually done by passing it to combineReducerscase function: a function that is being used to handle the update logic for a specific action. This may actually be a reducer function, or it may require other parameters to do its work properly.higher-order reducer: a function that takes a reducer function as an argument, and/or returns a new reducer function as a result (such as combineReducers, or redux-undo)


    2. irst and foremost, combineReducers is simply a utility function to simplify the most common use case when writing Redux reducers.


    3. functions should be relatively short and ideally only do one specific thing


    1. The current answers and the official documentation are outdated. And for those new to TypeScript, the terminology used isn't clear without examples. Below is a list of up-to-date differences.


    2. Both can be extended, but again, the syntax differs. Additionally, note that an interface and type alias are not mutually exclusive. An interface can extend a type alias, and vice versa


    1. 应用风格指南,值得参考的部分

    2. Redux itself does not care about how your application's folders and files are structured. However, co-locating logic for a given feature in one place typically makes it easier to maintain that code.Because of this, we recommend that most applications should structure files using a "feature folder" approach (all files for a feature in the same folder) or the "ducks" pattern (all Redux logic for a feature in a single file), rather than splitting logic across separate folders by "type" of code (reducers, actions, etc).


    1. 组件命名: 与文件名(除中缀外)完全一致。如果组件单独放置在目录中,则目录名也一致


    2. 。如果同一个文件夹下有同名而不同作用的js文件,则通过中缀(小写)进一步区分


    1. Any JavaScript style guide that is up-to-date for ES6 is going to cover nearly all TypeScript constructs except for type annotations, so I would start with your favorite JS style and decide on what you want the rules for type annotations to be


    1. JSX 的属性都采用双引号


    2. 属性名称始终使用驼峰命名法。


    3. 扩展名:React 组件使用.jsx扩展名;文件名:文件名使用帕斯卡命名。 例如: ReservationCard.jsx。引用命名:React 组件使用帕斯卡命名,引用实例采用驼峰命名


    1. 基于这个原因,我们推荐根据文件的上下文来命名文件,


  32. Mar 2020
    1. you can make the component a container component by wrapping it in a higher-order component returned by connect().


    2. react-redux包很简单,暴露了两个东西:Provider和connnect

    1. wrapping your entire application in a <Provider> component


    2. React Redux now offers a set of hook APIs as an alternative to the existing connect() Higher Order Component. These APIs allow you to subscribe to the Redux store and dispatch actions, without having to wrap your components in connect()

      React Redux提供的一些hook api可以用来替代connect高阶组件。用来订阅Redux Store和分发动作,而无需connect()

    1. Notice that none of these changed anything about how Redux works. We're still creating a Redux store, dispatching action objects that describe "what happened", and returning updated state using a reducer function. Also, notice that the Redux Toolkit functions can be used no matter what approach was used to build the UI, since they just handle the "plain Redux store" part of the code. Our example used the store with a "vanilla JS" UI, but we could use this same store with React, Angular, Vue, or any other UI layer.

      Redux Toolkit并没有侵入Redux。可以用在React,Angular,Vue和其它UI层。所以,我想,应该也可以用在Taro上面!

    1. A slice automatically generates reducers, action types, and action creators. As such, you'll only have to create one folder - slices


    2. And no longer requires you to install the redux-thunk or redux-devtools-extension dependencies.


    3. The ability to use direct state mutation, since RTK uses immer under the hood. This means you no longer need to return { ...state } with every reducer.


    1. the final source code structure looks like this


    2. The Redux Toolkit package is intended to be the standard way to write Redux logic. It was originally created to help address three common concerns about Redux:"Configuring a Redux store is too complicated""I have to add a lot of packages to get Redux to do anything useful""Redux requires too much boilerplate code"

      Redux Toolkit的用意是以标准方式编写Redux逻辑,帮助解决下面三个问题:

      • 配置store太复杂
      • 需要添加太多的包
      • 需要很多模板代码
    1. TS 采用结构子类型。其含义是:两个类型,即使表示的业务含义大相径庭,只要结构上有从属关系,就是兼容的。(“等同”也是从属关系的一种)


    1. To do that, the react-redux library comes with 2 things: a component called Provider, and a function called connect.

      react-redux带来两样东西: 一个叫Provider的组件 一个叫connect的函数

    2. Changes happen one way, and one way only: dispatch(action) -> reducer -> new state.

      改变是单向的: 分发动作->reducer->新状态

    3. Reducer Rule #2: Reducers must be pure functions.


    1. Redux has changed a lot. Redux toolkit has become the recommended way to use Redux and new codebases based on Redux toolkit will differ a lot from what you'll find in this tutorial. However the fundamental building blocks of Redux are still action, reducers, middleware, and the store. A good knowledge of these building blocks is required to be proficient with Redux and Redux toolkit. After reading this tutorial you can tune on this free Redux course of mine where I'll cover Redux toolkit in the near future.


    1. useEffect serves the same purpose as componentDidMount, componentDidUpdate, and componentWillUnmount in React classes, but unified into a single API


    1. This means you can write code that "mutates" the state inside the reducer, and Immer will safely return a correct immutably updated result.


    2. automatically handle all other action types by returning the current state


    3. in most apps, you won't need to use them yourself - createSlice is all you need.


    4. The first big step for rewriting the app is to convert the todos logic into a new "slice".