JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

Syntax Error when using rxjs share

Open Vx2gas opened this issue 9 years ago • 1 comments

Hello,

I'm stumped. It seems when I use the share function in rxjs, I get a syntax error.

I use the following import: import 'rxjs/add/operator/share';

Then I use the following code:

var result = this._http.delete(this.url + '/' + item.id, options)
			.map((res: Response) => res.json());

var shareable = result.share();
shareable.subscribe(null, error => {	
});

image

What am I doing wrong? Any help would be greatly appreciated!

Vx2gas avatar Jan 26 '17 17:01 Vx2gas

This is not an issue. After digging around, its because I was using res.json() and the body was empty.

Vx2gas avatar Jan 26 '17 18:01 Vx2gas