GithubHelp home page GithubHelp logo

rlugojr / ixjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reactive-extensions/ixjs

0.0 2.0 0.0 666 KB

Interactive Extensions for JavaScript

License: Other

JavaScript 99.58% Batchfile 0.08% HTML 0.34%

ixjs's Introduction

Build Status

The Interactive Extensions for JavaScript...

...is a set of libraries to compose pull-based collections and LINQ-style query operators in JavaScript

The Interactive Extensions for JavaScript (IxJS) is an implementation of Language Integrated Query (LINQ) to Objects in native JavaScript with a core set of operators on par with the .NET implementation. This implementation uses the same techniques for lazy evaluation of chained functions, for example map/select and filter/where. This allows you as the user to write rich expressive queries against a number of data sources without taking a performance hit.

We provide two files, a core implementation of LINQ to Objects in l2o.js and the Interactive Extensions in ix.js. The Interactive Extensions is a set of functions that were found to be useful for the Reactive Extensions (Rx) and were ported from the push model of Rx to a pull model.

Getting started is easy. Just reference the IxJS files:

<script src="l2o.js"></script>
<script src="ix.js"></script>

Next, we could generate data, filter it and then display the results

// Generate the data
var data = Ix.Enumerable.range(0, 10);

// Query the data
var query = data
	.map( function (x) {
		return x * x;
	})
	.filter( function (x) {
		return x % 3 === 0;
	});

// Now execute the query
query.forEach( function (x, idx) {
	console.log(x, idx);
});

Note the execution of the query doesn't take place until forEach is called.

This project is a mirror of the CodePlex repository.

About the Interactive Extensions Extensions

This set of libraries include:

  • l2o.js - Core LINQ to Objects library
  • ix.js - Interactive Extensions for JavaScript

API Documentation

You can find the documentation here as well as examples here.

Installation and Usage

There are multiple ways of getting started with the Interactive Extensions. The files are available on cdnjs and jsDelivr.

In a Browser:

<script src="l2o.js"></script>
<script src="ix.js"></script>

Installing with Bower

bower install Ix

Installing with Jam

jam install ix

Installing via NPM:

npm install ix
npm install -g ix

Using in Node.js:

var Ix = require('ix');

var source = Ix.Enumerable.fromArray([1,2,3]);

source.forEach(function (x) {
	console.log('Next: ' + x);	
});

// => Next 1 
// => Next 2 
// => Next 3

Installing all of IxJS via NuGet:

Install-Package IxJS-All

Or install via NuGet individual packages:

Install-Package IxJS-L2O
Install-Package IxJS-Main

Using IxJS with an AMD loader such as Require.js

require({
    'paths': {
        'ix': 'path/to/ix.js'
    }
},
['ix'], function(Ix) {
    var obs = Ix.Enumerable.returnValue(42);
    obs.forEach(function (x) { 
    	console.log('Next: ' + x); 
	});
});

// => Next 42 

Compatibility

IxJS has been thoroughly tested against all major browsers and supports IE6+, Chrome 4+, FireFox 1+, and Node.js v0.4+.

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 http://rx.codeplex.com/wikipage?title=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.

ixjs's People

Contributors

mattpodwysocki avatar leecampbell avatar elmerbulthuis avatar mvschaik avatar

Watchers

Ray Lugo, Jr. avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.