Set Raven-js context with function

Hello. I have mobx store, which I want to attach to every sentry event. But since it is not plain object I have to use serialize function. Is there way to declare that function globally? Something like this

function getStore() {}

Raven.setExtraContext({
  store: getStore,
  foo: "bar"
});