reyesoft / ngx-jsonapi

JSON API client library for Angular 5+ 👌 :: Production Ready 🚀
https://ngx-jsonapi.reyesoft.com/
MIT License
101 stars 52 forks source link

Service.get() do not return the resource if TTL is enabled #198

Closed ivelichko closed 5 years ago

ivelichko commented 5 years ago

If TTL is enabled and resource is alive, .get call returns a Subject which cannot be properly subscribed. https://github.com/reyesoft/ngx-jsonapi/blob/v2.0/src/service.ts#L82 - here .complete() is called, which completes the returning Subject And this .next call has no effect: https://github.com/reyesoft/ngx-jsonapi/blob/v2.0/src/service.ts#L104

I'd suggest to call .next before .complete in that case

pablorsk commented 5 years ago

Related with #208, maybe your problem will fixed.

ivelichko commented 5 years ago

Related with #208, maybe your problem will fixed.

Thanks, I'll recheck when #208 is merged

pablorsk commented 5 years ago

Now, is fully tested :) No same problem again :smile: