Skip to content

make isEmpty an accessor so it reacts to value mutations

Compare
Choose a tag to compare
@MZanggl MZanggl released this 05 Jan 06:03
· 43 commits to master since this release

See test for details

test('isEmpty reacts to value changes', async (assert) => {
    const state = promistate(() => [], { defaultValue: [1] })
    assert.isFalse(state.isEmpty)

    state.value = []
    assert.isTrue(state.isEmpty)
})