I am trying to import Rxjs library into my common utils component in LWC. I am not able to achieve that. Please help on this Rxjs,js
import {
LightningElement
} from 'lwc';
import {
loadScript
} from "lightning/platformResourceLoader";
import rxjs from "@salesforce/resourceUrl/rxjs";
export default class Rxjs extends LightningElement {
myMessage;
connectedCallback() {
loadScript(this, rxjs + "/Rx.min.js").then(() => {
})
.catch(error => {
console.log("error" + JSON.stringify(error));
});
}
}
messageService.js
import Rxjs from 'c/rxjs';
class messageService extends Rxjs {
myMessage = new Subject();
getMessage() {
return this.myMessage.asObservable();
}
updateMessage(message) {
this.myMessage.next(message);
}
}
export const {
getMessage,
updateMessage
} = new messageService()
And in my LWC component i am trying to use like this
import {
getMessage,
updateMessage
} from 'c/messageService'
But I am getting default error pop up given by salesforce
Error in $A.getCallback() [Unknown error creating component: c:firstComponent]
createComponentErrorProcessor()@https://chaarvim-dev-ed.lightning.force.com/libraries/force/componentLibrary/errors.js:10:307
Can you please help me what i am doing wrong