Skip to content

reaction方法内部修改监听对象的值,外部多次修改时,值的监听失效。 #99

@xjf7711

Description

@xjf7711

test('watch with inner reset ', () => {
const value = signal(false)

reaction(value, () => {
    value(false)
})

value(true)
expect(value()).toBe(false) // 正确
value(true)
expect(value()).toBe(false) // 错误, 仍然是 true

})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions