MCPcopy
hub / github.com/mobxjs/mobx / createItem

Function createItem

packages/mobx-react/__tests__/issue21.test.tsx:125–149  ·  view source on GitHub ↗
(subid, label)

Source from the content-addressed store, hash-verified

123
124test("verify prop changes are picked up", () => {
125 function createItem(subid, label) {
126 const res = observable(
127 {
128 subid,
129 id: 1,
130 label: label,
131 get text() {
132 events.push(["compute", this.subid])
133 return (
134 this.id +
135 "." +
136 this.subid +
137 "." +
138 this.label +
139 "." +
140 data.items.indexOf(this as any)
141 )
142 }
143 },
144 {},
145 { proxy: false }
146 )
147 res.subid = subid // non reactive
148 return res
149 }
150 const data = observable({
151 items: [createItem(1, "hi")]
152 })

Callers 2

issue21.test.tsxFile · 0.85
changeStuffFunction · 0.85

Calls 1

observableFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…