node-ddp-client
node-ddp-client copied to clipboard
Collection Observer
after subscribing the collection the when we register a observer it says "underfined is not a functiuon"
I'm seeing the exact same error. Seems to be a bug in the mini-mongo implementation? Is there any workaround?
Actually, looking into this a little further, it seems you need to 'polyFill' the process.nextTick to get minimongo-cache to work in react native. See: https://github.com/petehunt/minimongo-cache
To fix it you need to add the following to the top of your react native js (before creating the ddp client):
if (typeof this.process === 'undefined') {
process = {};
process.nextTick = setImmediate;
}
Thanks @scottsykora You saved me several hours!
@scottsykora what if process is not undefined, do you also need to set process.nextTick = setImmediate; ?
@Taakn I'm not sure. If it's already defined then it should be an object that has nextTick defined, but if you're having issues you could give it a try. The above was really just a hack to get my implementation working, the core issue should probably be fixed in the library itself in a more robust way.