We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent abd3ae4 commit d083b69Copy full SHA for d083b69
v1/composition/composition.go
@@ -76,6 +76,14 @@ func (c *Component) Prop(key string, sig signalAny) {
76
c.HTMLComponent.Props[key] = sig
77
}
78
79
+// IDSignal exposes the component's ID as a state.Signal stored under the "id" prop.
80
+// Updating the returned signal does not modify the component's actual ID.
81
+func (c *Component) IDSignal() *state.Signal[string] {
82
+ s := state.NewSignal(c.ID)
83
+ c.Prop("id", s)
84
+ return s
85
+}
86
+
87
// OnUnmount cleans up the composition store when the component is removed.
88
func (c *Component) OnUnmount() {
89
for name := range c.createdStores {
0 commit comments