(value: ReactiveValue<TValue>)
| 18 | |
| 19 | return { |
| 20 | reactive<TValue>(value: ReactiveValue<TValue>) { |
| 21 | const current = value(); |
| 22 | const reactive: Reactive<TValue> = { |
| 23 | _fn: value, |
| 24 | _ref: { current }, |
| 25 | get value() { |
| 26 | return this._ref.current; |
| 27 | }, |
| 28 | set value(value) { |
| 29 | this._ref.current = value; |
| 30 | }, |
| 31 | }; |
| 32 | |
| 33 | reactives.push(reactive); |
| 34 | |
| 35 | return reactive; |
| 36 | }, |
| 37 | runReactives() { |
| 38 | reactives.forEach((value) => { |
| 39 | value._ref.current = value._fn(); |
no test coverage detected