Starfinder Playlist
  1. #1

    Potential Issue with Add Handler Documentation?

    Hi, I am really struggling with

    function addHandler( nodepath, event, callback )
    * [onChildUpdate] parameters = (nodeParent, nodeChildUpdated)

    https://fantasygroundsunity.atlassia...ges/4063529/DB

    The other handlers work intuitively, but the onChildUpdate does not do what I'd expect. I would expect it to return the DB path of parent and the DB path of the child that was updated.

    I have it "working" and it is correctly returning the expected parent path, but instead of retuning the "nodeChildUpdated" path as shown in the documentation, it's returning a boolean value. I have no idea what that value would be. It is also firing multiple times on a single update.
    I made some guesses and tested, but none of them seem right.

    1. Thought it might be whether or not a child was actually updated. This doesnt make sense though because it has to be true in order for the handler to fire, so doesn't explain why I am ever getting false.
    2. The handler will fire multiple times when I do this, so thought it might be giving me an answer for each child, whether or not it was updated. But the number of responses is not matching the number of children, so don't think that is it either.

    Anyone know what the second value being returned is? And if there is a way to get the path of the child updated?

    I think the documentaiton might be out of date here. Any help would be appreciated.

  2. #2
    The documentation for DB.addHandler was incorrect; and I updated the name of the second parameter. Please look at databasenode.onChildUpdate for more detail.

    The second parameter basically is just a boolean indicator whether the list of children changed or not. (i.e. children added/deleted)

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    The documentation for DB.addHandler was incorrect; and I updated the name of the second parameter. Please look at databasenode.onChildUpdate for more detail.

    The second parameter basically is just a boolean indicator whether the list of children changed or not. (i.e. children added/deleted)

    Regards,
    JPG
    Thanks for the quick response. Much appreciated.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Character Create Playlist

Log in

Log in