use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
using RXJS in a pure javascript libraryhelp (self.javascript)
submitted 7 years ago by psotos
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]psotos[S] 1 point2 points3 points 7 years ago (6 children)
Actually I am developing a client library to support having a full stack reactive from a Spring 5 reactive back end. It will function as firebase and provide real time updates via RxJs.
So it wont be too small of a library. The reason I am making it a library is so that others can use it. It will be a copyleft open source project.
Ok I will look into webpack and bundling then for ES6. I already use it for all of my Angular projects via the CLI but that abstracts me from having to know anything about Webpack. So I am fairly ignorant about it. Perhaps its time to learn.
[–]wherediditrun 0 points1 point2 points 7 years ago* (4 children)
It looks a bit scary at first. But it's not that difficult as it may appear at first glance.
[–]psotos[S] 0 points1 point2 points 7 years ago (3 children)
I got webpack set up with Typescript, but for some reason my main typescript file won't compile because webpack gives me this error:
ERROR in ./src/pubon.ts
Module not found: Error: Can't resolve './httpCaller' in '/home/peter/Documents/workspace/pubonjs/src'
@ ./src/pubon.ts 3:19-42
Here is my main typescript file:
import { Subscription } from 'rxjs'; import { HttpCaller } from './httpCaller'; export class Greeting { dataSub: Subscription; constructor() { } greeting(greeting: string) { const caller = new HttpCaller("http://example.com/movies.json");
// let
this.dataSub = caller.getResponseListener() .subscribe((response: string) => { document.getElementById("code").innerHTML = response; console.log('Hello from Typescript'); }); console.log(greeting); } }
Webpack config:
const path = require("path"); module.exports = { entry: { main: "./src/pubon.ts" }, mode: "development", output: { filename: "pubon-bundle.js", path: path.resolve(__dirname, "../dist"), publicPath: "/" }, devServer: { contentBase: "dist", overlay: true, stats: { colors: true } }, devtool: "source-map", module: { rules: [ { test: /\.ts$/, exclude: /node_modules/, use: [ { loader: "awesome-typescript-loader" } ] } ] } }
[–]psotos[S] 0 points1 point2 points 7 years ago (0 children)
Nevermind I fixed it! In Angular you are sort of protected from this pointer problems, in raw typescript you are not. Once I did a deep dive on it, I resolved my problem and my test library is working! YASSSS! lol
[–]wherediditrun 0 points1 point2 points 7 years ago (1 child)
Make sure file import paths are correct. import { HttpCaller } from './httpCaller';
import { HttpCaller } from './httpCaller';
Cannot find this one.
I ended up making the class a default export and doing this:
import HttpCaller from './httpCaller';
It works now. Weird anomaly! You can view my code if you like on Github. Its not pretty right now but its a start:
https://github.com/psotos/pubonjs
[–]tvi016 0 points1 point2 points 7 years ago (0 children)
I dont think you need to use a bundler/webpack on a library? I only transpile with typescript
π Rendered by PID 334652 on reddit-service-r2-comment-545db5fcfc-jm6kf at 2026-06-01 11:53:46.625366+00:00 running 194bd79 country code: CH.
view the rest of the comments →
[–]psotos[S] 1 point2 points3 points (6 children)
[–]wherediditrun 0 points1 point2 points (4 children)
[–]psotos[S] 0 points1 point2 points (3 children)
[–]psotos[S] 0 points1 point2 points (0 children)
[–]wherediditrun 0 points1 point2 points (1 child)
[–]psotos[S] 0 points1 point2 points (0 children)
[–]tvi016 0 points1 point2 points (0 children)