Socket
Socket
Sign inDemoInstall

rx-lite

Package Overview
Dependencies
0
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rx-lite

Lightweight library for composing asynchronous and event-based operations in JavaScript


Version published
Weekly downloads
1.4M
decreased by-15.42%
Maintainers
1
Install size
449 kB
Created
Weekly downloads
 

Package description

What is rx-lite?

The rx-lite npm package is a lightweight version of RxJS, which provides a core set of functionality for reactive programming with observables. It allows developers to compose asynchronous and event-based programs using observable sequences.

What are rx-lite's main functionalities?

Creating Observables

This feature allows the creation of observables. Observables are data streams that can emit multiple values over time, and they are the core abstraction in RxJS.

var Rx = require('rx-lite');

var observable = Rx.Observable.create(function (observer) {
  observer.onNext('Hello, World!');
  observer.onCompleted();
});

observable.subscribe(function (x) {
  console.log(x);
});

Transforming Data Streams

This feature demonstrates the 'map' operator, which transforms each item emitted by an observable by applying a function to it.

var Rx = require('rx-lite');

var source = Rx.Observable.range(1, 5);
var mapped = source.map(function (x) { return x * x; });

mapped.subscribe(function (x) {
  console.log(x);
});

Filtering Data Streams

This feature shows the 'filter' operator, which emits only those items from an observable that pass a predicate test.

var Rx = require('rx-lite');

var source = Rx.Observable.from([1, 2, 3, 4, 5]);
var filtered = source.filter(function (x) { return x % 2 === 0; });

filtered.subscribe(function (x) {
  console.log(x);
});

Combining Multiple Streams

This feature illustrates how to combine multiple observables into one observable sequence using the 'concat' operator.

var Rx = require('rx-lite');

var stream1 = Rx.Observable.of('Hello');
var stream2 = Rx.Observable.of('World');
var combined = Rx.Observable.concat(stream1, stream2);

combined.subscribe(function (x) {
  console.log(x);
});

Other packages similar to rx-lite

Readme

Source

RxJS Lite Module

The Reactive Extensions for JavaScript Lite version is a lightweight version of the Reactive Extensions for JavaScript which covers most of the day to day operators you might use all in a single library. Functionality such as bridging to events, promises, callbacks, Node.js-style callbacks, time-based operations and more are built right in. This comes with rx.lite.js which is for use in modern development environments such as > IE9 and server-side environments such as Node.js.

Getting Started

There are a number of ways to get started with RxJS.

Installing with NPM

```bash` $ npm install rx-lite $ npm install -g rx-lite


### Using with Node.js and Ringo.js

```js
var Rx = require('rx-lite');

In a Browser:

<!-- Just the core RxJS -->
<script src="path/to/rx.lite.js"></script>

Included Observable Operators

Observable Methods

Observable Instance Methods

Included Classes

Core Objects

Subjects

Schedulers

Disposables

Contributing

There are lots of ways to contribute to the project, and we appreciate our contributors. If you wish to contribute, check out our style guide.

You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submit bugs and help us verify fixes as they are checked in, as well as submit code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.

License

Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Microsoft Open Technologies would like to thank its contributors, a list of whom are at https://github.com/Reactive-Extensions/RxJS/wiki/Contributors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Keywords

FAQs

Last updated on 17 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc