Skip to content

bound* causes error in certain circumstances #1

@onlyafly

Description

@onlyafly

I discovered this error in my own application, but I have reproduced it at the Widje example at https://github.com/lynaghk/todoFRP/tree/master/todo/widje

Steps to reproduce:

  1. Launch the widje To Do application.
  2. Create three todo items called "a", "b", and "c"
  3. Delete "c".
  4. Attempt to edit "b"
  5. Notice the JavaScript error "No protocol method IDeref.-deref defined for type null:"

Notes:

This seems to be caused by line 62 of widje/core.cljs:

(-value [this] (apply value-func (map deref atoms)))

When one of the atoms used in a bound* is a SubAtom produced using bound-coll, it can sometimes attempt to deref a nil atom, leading to the deref error. This seems to only occur after removing an element in the bound collection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions