mirror of
https://github.com/status-im/pluto.git
synced 2026-08-31 12:31:08 +00:00
1.1 KiB
1.1 KiB
title, sidebar_label
| title | sidebar_label |
|---|---|
| Query | Query |
Queries are exposed by the platform in the form of :queries key in the capacities map.
Only those queries which are exposed can be either referenced by hook property (when the property is of the type :query),
or used to read data in let block in view .
Query as hook property
To refer to some query via hook property (might be required for some host app hooks), the property must be defined as :query type
by the app-hook and extension must correctly refer to query from capacities map.
Example
;; Capacities map in the host application
{:capacities {:queries {'network-up ...}}}
;; Extension hook data
hooks/wallet-asset.next-coin
{:able-to-send [network-up]}
Queries in views
To use some queries in extension defined view, the query must be exposed via capacities map of the host platform.
Example
;; Capacities map in the host application
{:capacities {:queries {'store/get ...}}}
;; Extension view data
views/coin-item
[view {}
(let [current-network [store/get {:networks :current}]]
[text {} "Current network: "]
[text {} current-network]])