mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
7a5940d076
See [discourse]. [discourse]: https://discuss.daml.com/t/best-practice-for-getting-ledger-state-in-multiple-nested-react-components/1814/3 CHANGELOG_BEGIN * [JavaScript Client Libraries] When using our React wrapper from TypeScript, users could end up having to manually reconstruct a `QueryResult` type for a specific template, leading to code looking like (assuming a `User` template): ``` const allUser: QueryResult<User.User, User.User.Key, typeof User.User.templateId> = useStreamQueries(User.User); ``` Our codegen will now generate an additional type definition per template such that the above can be rewritten as ``` const allUser: User.User.QueryResult = useStreamQueries(User.User); ``` Developers using our JavaScript bindings directly (i.e. without taking advantage of the TS type definitions) are not affected. Existing (long-form) type declaractions will also keep working. Note: In order to make this change, we had to move the definition of the `QueryResult` type from the `@daml/react` package to the `@daml/ledger` package. However, the `@daml/react` package is still exporting it as before, so this is a backwards-compatible change. CHANGELOG_END |
||
---|---|---|
.. | ||
codegen-common | ||
codegen-main | ||
hs/bindings | ||
java | ||
scala | ||
ts |