8000 Optional observe callback not called · Issue #298 · Starcounter-Jack/JSON-Patch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
Optional observe callback not called #298
Open
@hamptonsmith

Description

@hamptonsmith

Hey folks! Thanks for an awesome library.

Am I misreading the observe() documentation regarding the optional callback? Documentation says "When changes are detected, the optional callback is called", but I'm not seeing that behavior:

Welcome to Node.js v16.14.2.
Type ".help" for more information.
> var fastJsonPatch = require('fast-json-patch')
undefined
> var doc = {};
undefined
> fastJsonPatch.observe(doc, function(p) { console.log(p); })
{ /* snip */ }
> doc.foo = 'bar';
'bar'
>

I'm expecting to see the patch array console.log()'d via the callback, but the callback is never called.

Calling generate() flushes the changes and I then see them printed via the callback.

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

      0