Files
Devour/devour_data/docs/observable.json
T
Tomas Dvorak 898a3c303f update
2026-02-24 10:33:59 +01:00

17 lines
1.7 KiB
JSON

{
"id": "47dbe15aeddc2cf9eefff2ae",
"source": "solid:signals",
"type": "github-document",
"title": "observable",
"content": "---\ntitle: observable\nuse_cases: \u003e-\n rxjs integration, observable patterns, signal interop, third-party libraries,\n reactive streams\ntags:\n - observables\n - rxjs\n - signals\n - integration\n - reactive\n - streams\nversion: '1.0'\ndescription: \u003e-\n Convert SolidJS signals to Observables for seamless integration with RxJS and\n other reactive libraries using the observable utility function.\n---\n\n```ts\nimport { observable } from \"solid-js\"\n\nfunction observable\u003cT\u003e(input: () =\u003e T): Observable\u003cT\u003e\n\n```\n\nThis method takes a signal and produces an Observable.\nYou can consume it from another Observable library of your choice, typically with the `from` operator.\n\n```ts\n// How to integrate rxjs with a Solid signal\nimport { observable } from \"solid-js\"\nimport { from } from \"rxjs\"\n\nconst [s, set] = createSignal(0)\n\nconst obsv$ = from(observable(s))\n\nobsv$.subscribe((v) =\u003e console.log(v))\n```\n\nYou can also use `from` without rxjs; check out this [page](/reference/reactive-utilities/from).",
"url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/reference/reactive-utilities/observable.mdx",
"metadata": {
"path": "src/routes/reference/reactive-utilities/observable.mdx",
"repo": "solidjs/solid-docs",
"repo_url": "https://github.com/solidjs/solid-docs.git",
"size": 994,
"source_type": "github"
},
"hash": "ae00b4e1a3e5eece8735e1186eaf3ddd421fa409fb55d3a91021ddc877b99410",
"timestamp": "2026-02-23T11:43:00.190029609+01:00"
}