mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 06:02:32 -05:00
Docs
This commit is contained in:
parent
a79d1013bf
commit
908cc2240f
1 changed files with 6 additions and 1 deletions
|
@ -86,7 +86,12 @@
|
|||
|
||||
(defonce !tokens-cache (atom nil))
|
||||
|
||||
(defn use-resolved-tokens [tokens]
|
||||
(defn use-resolved-tokens
|
||||
"The StyleDictionary process function is async, so we can't use resolved values directly.
|
||||
|
||||
This hook will return the unresolved tokens as state until they are processed,
|
||||
then the state will be updated with the resolved tokens."
|
||||
[tokens]
|
||||
(let [tokens-state (mf/use-state (get @!tokens-cache tokens tokens))]
|
||||
(mf/use-effect
|
||||
(mf/deps tokens)
|
||||
|
|
Loading…
Add table
Reference in a new issue