You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure where this issue belongs/must be fixed, so I'm opening in both repositories, since @bago is KO Reactor contributor and KO Undo Manager author.
According to KO Reactor (link), it supports a context option, which is undocumented. Looking at its usages in assignWatcher function, context should be a function.
However, KO Undo Manager is building an empty object (link) as context and is passing it to KO Reactor (link).
This leads to a TypeError: context is not a function error.
At this point, there are 2 options:
KO Undo Manager passing an empty function instead of empty object, which is what KO Reactor expects
KO Reactor checking if context is a function before executing it, e.g. typeof context === 'function' && context(returnValue) instead of context(returnValue).
Additionally, it might help if KO Reactor's context option is documented to indicate how it should look like.
I am happy to contribute with a PR if needed, I'm just not sure what's the correct way to handle this. Both options would be backwards-compatible.
The text was updated successfully, but these errors were encountered:
I am not sure where this issue belongs/must be fixed, so I'm opening in both repositories, since @bago is KO Reactor contributor and KO Undo Manager author.
According to KO Reactor (link), it supports a
context
option, which is undocumented. Looking at its usages inassignWatcher
function, context should be a function.However, KO Undo Manager is building an empty object (link) as
context
and is passing it to KO Reactor (link).This leads to a
TypeError: context is not a function
error.At this point, there are 2 options:
typeof context === 'function' && context(returnValue)
instead ofcontext(returnValue)
.Additionally, it might help if KO Reactor's context option is documented to indicate how it should look like.
I am happy to contribute with a PR if needed, I'm just not sure what's the correct way to handle this. Both options would be backwards-compatible.
The text was updated successfully, but these errors were encountered: