Skip to content

Instantly share code, notes, and snippets.

View ZenabKhan's full-sized avatar

Zainab Salim ZenabKhan

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/5.5.5/Rx.js"></script>
</head>
<body>

Introduction to RxJS Observables: Creating Observables

Intro to RxJS

RxJS stands for Reactive Extension for JavaScript. It’s a library to work with asynchronous data streams or observables. These data streams can be created from many things. For example, from UI events, Http requests, File systems, Array-like objects or Memory/Cache. A Stream is a sequence of ongoing events ordered in time. It can emit value, error or completed signal. To work with these streams, we need to observe what they emit. Here comes the role of RxJS. We can work with these streams along with RxJS Observables.

What are Observables?

Observables are like watchers on the stream and and they emit a function when stream returns a value, error or a signal. These can be subscribed with observers. Observables are constantly watching the data stream. It comes with a bunch of operators which can allow us to filter, compose, select, combine and transform observables.

Create Observable

I am not adding the steps to setup RxJS en

Useful Git Commands

Make git repository

//You ned to go inside the project folder
git init

Clone repo

git clone <repo link>