mirror of
https://github.com/Dvorinka/Devour.git
synced 2026-06-03 20:13:03 +00:00
17 lines
2.5 KiB
JSON
17 lines
2.5 KiB
JSON
{
|
|
"id": "ad9929e18eff55167667493d",
|
|
"source": "solid:signals",
|
|
"type": "github-document",
|
|
"title": "derived-signals",
|
|
"content": "---\ntitle: Derived signals\norder: 1\nuse_cases: \u003e-\n computed values, reactive calculations, dependent state, dynamic values from\n signals\ntags:\n - signals\n - reactivity\n - derived\n - computed\n - state\nversion: '1.0'\ndescription: \u003e-\n Create reactive derived values that automatically update when their\n dependencies change using Solid's derived signals.\n---\n\nDerived signals are functions that rely on one or more [signals](/concepts/signals) to produce a value.\n\nThese functions are not executed immediately, but instead are only called when the values they rely on are changed.\nWhen the underlying signal is changed, the function will be called again to produce a new value.\n\n```js\nconst double = () =\u003e count() * 2;\n```\n\nIn the above example, the `double` function relies on the `count` signal to produce a value.\nWhen the `count` signal is changed, the `double` function will be called again to produce a new value.\n\nSimilarly you can create a derived signal that relies on a store value because stores use signals under the hood.\nTo learn more about how stores work, [you can visit the stores section](/concepts/stores).\n\n```js\nconst fullName = () =\u003e store.firstName + ' ' + store.lastName;\n```\n\nThese dependent functions gain reactivity from the signal they access, ensuring that changes in the underlying data propagate throughout your application.\nIt is important to note that these functions do not store a value themselves; instead, they can update any effects or components that depend on them.\nIf included within a component's body, these derived signals will trigger an update when necessary.\n\nWhile you can create derived values in this manner, Solid created the [`createMemo`](/reference/basic-reactivity/create-memo) primitive.\nTo dive deeper into how memos work, [check out the memos section](/concepts/derived-values/memos).",
|
|
"url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/concepts/derived-values/derived-signals.mdx",
|
|
"metadata": {
|
|
"path": "src/routes/concepts/derived-values/derived-signals.mdx",
|
|
"repo": "solidjs/solid-docs",
|
|
"repo_url": "https://github.com/solidjs/solid-docs.git",
|
|
"size": 1851,
|
|
"source_type": "github"
|
|
},
|
|
"hash": "6f86857e60203bf5a1621641ee13f840a21f2a12063995d3d9c0a16fd2eba229",
|
|
"timestamp": "2026-02-23T11:43:00.186698839+01:00"
|
|
} |