├── .gitattributes
├── concurrent
├── index.html
├── index.js
├── state_1.js
├── state_2.js
├── styles.css
├── subject.js
├── asyncSubject_1.js
└── asyncSubject_2.js
├── react-demos
└── react-recompoes-demo
│ ├── .nvmrc
│ ├── public
│ ├── favicon.ico
│ ├── manifest.json
│ └── index.html
│ ├── src
│ ├── index.js
│ ├── App.test.js
│ ├── index.css
│ └── App.js
│ ├── config
│ ├── jest
│ │ ├── fileTransform.js
│ │ └── cssTransform.js
│ ├── polyfills.js
│ ├── paths.js
│ ├── env.js
│ ├── webpackDevServer.config.js
│ └── webpack.config.dev.js
│ ├── .gitignore
│ ├── scripts
│ ├── test.js
│ ├── start.js
│ └── build.js
│ └── package.json
├── drag-drop
├── logo.png
├── custom.css
├── index.html
└── dragdrop.js
├── mario
├── img
│ ├── jump-left.gif
│ ├── jump-right.gif
│ ├── stand-left.gif
│ ├── stand-right.gif
│ ├── walk-left.gif
│ └── walk-right.gif
├── custom.css
├── polyfills.js
├── index.html
└── custom.js
├── crop
├── images
│ └── leaf-twirl.jpg
├── custom.css
├── index.html
├── requestanimationframescheduler.js
└── crop.js
├── docs
├── logo
│ ├── RxJSplayground.jpg
│ ├── RxJSplayground-logomark.png
│ ├── RxJSplayground-logotype.png
│ └── License
├── OBSERVABLE_PIPELINE.md
├── rxjs_ng_europe.js
├── SUBJECT.md
└── OBSERVABLE.md
├── image-color-selector
├── image.png
├── style.css
├── index.html
└── script.js
├── virtual-list
├── images
│ ├── 0
│ │ ├── 822761.jpg
│ │ ├── 829299.jpg
│ │ ├── 829508.jpg
│ │ ├── 830288.jpg
│ │ ├── 840951.jpg
│ │ ├── 841112.jpg
│ │ ├── 841246.jpg
│ │ ├── 841257.jpg
│ │ ├── 841270.jpg
│ │ ├── 841271.jpg
│ │ ├── 841337.jpg
│ │ ├── 850831.jpg
│ │ └── 851778.jpg
│ ├── 1
│ │ ├── 868813.jpg
│ │ ├── 868989.jpg
│ │ ├── 868992.jpg
│ │ ├── 868994.jpg
│ │ ├── 869023.jpg
│ │ ├── 869096.jpg
│ │ ├── 869203.jpg
│ │ ├── 869237.jpg
│ │ ├── 869380.jpg
│ │ ├── 869382.jpg
│ │ ├── 869386.jpg
│ │ ├── 869476.jpg
│ │ └── 869508.jpg
│ ├── 2
│ │ ├── 869510.jpg
│ │ ├── 869516.jpg
│ │ ├── 869533.jpg
│ │ ├── 869541.jpg
│ │ ├── 869548.jpg
│ │ ├── 872532.jpg
│ │ ├── 925010.jpg
│ │ ├── 925077.jpg
│ │ ├── 928203.jpg
│ │ ├── 929016.jpg
│ │ ├── 930241.jpg
│ │ ├── 1585264.jpg
│ │ ├── 1585360.jpg
│ │ └── 1641134.jpg
│ └── 3
│ │ ├── 1712289.jpg
│ │ ├── 1829772.jpg
│ │ ├── 2036766.jpg
│ │ ├── 2086307.jpg
│ │ ├── 2091847.jpg
│ │ ├── 2171006.jpg
│ │ ├── 2171910.jpg
│ │ ├── 2187391.jpg
│ │ ├── 2316690.jpg
│ │ ├── 2324402.jpg
│ │ ├── 2325775.jpg
│ │ ├── 2365903.jpg
│ │ ├── 2371520.jpg
│ │ └── 2372627.jpg
├── styles.css
├── index.html
└── index.js
├── letter-count
├── custom.css
├── custom.js
└── index.html
├── canvas-paint
├── custom.css
├── index.html
└── custom.js
├── .editorconfig
├── animation
├── custom.css
├── index.html
└── custom.js
├── infinite-scroll
├── styles.css
├── index.html
└── index.js
├── .gitignore
├── real-time
├── custom.css
├── index.html
└── custom.js
├── mouse-tracking
├── index.html
└── script.js
├── follow-the-mouse
├── custom.css
├── index.html
└── custom.js
├── CONTRIBUTING.md
├── LICENSE
├── smart-counter
├── index.html
└── index.js
├── debt-calculator
├── index.html
├── style.css
└── index.js
├── typehead
├── index.html
└── typehead.js
├── dynamic-render
├── index.html
└── script.js
├── data-binding
├── index.html
└── custom.js
├── github-fetch
├── index.html
└── index.js
├── README.md
├── CODE_OF_CONDUCT.md
└── common
├── js
└── RxJS
│ └── rx.selectors.js
└── css
└── bootstrap-responsive.min.css
/.gitattributes:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/index.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/state_1.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/state_2.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/styles.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/subject.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/asyncSubject_1.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/concurrent/asyncSubject_2.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/.nvmrc:
--------------------------------------------------------------------------------
1 | v8
2 |
--------------------------------------------------------------------------------
/drag-drop/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/drag-drop/logo.png
--------------------------------------------------------------------------------
/mario/img/jump-left.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/mario/img/jump-left.gif
--------------------------------------------------------------------------------
/mario/img/jump-right.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/mario/img/jump-right.gif
--------------------------------------------------------------------------------
/mario/img/stand-left.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/mario/img/stand-left.gif
--------------------------------------------------------------------------------
/mario/img/stand-right.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/mario/img/stand-right.gif
--------------------------------------------------------------------------------
/mario/img/walk-left.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/mario/img/walk-left.gif
--------------------------------------------------------------------------------
/mario/img/walk-right.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/mario/img/walk-right.gif
--------------------------------------------------------------------------------
/crop/images/leaf-twirl.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/crop/images/leaf-twirl.jpg
--------------------------------------------------------------------------------
/docs/logo/RxJSplayground.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/docs/logo/RxJSplayground.jpg
--------------------------------------------------------------------------------
/image-color-selector/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/image-color-selector/image.png
--------------------------------------------------------------------------------
/virtual-list/images/0/822761.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/822761.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/829299.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/829299.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/829508.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/829508.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/830288.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/830288.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/840951.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/840951.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/841112.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/841112.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/841246.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/841246.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/841257.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/841257.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/841270.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/841270.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/841271.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/841271.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/841337.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/841337.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/850831.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/850831.jpg
--------------------------------------------------------------------------------
/virtual-list/images/0/851778.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/0/851778.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/868813.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/868813.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/868989.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/868989.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/868992.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/868992.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/868994.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/868994.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869023.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869023.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869096.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869096.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869203.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869203.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869237.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869237.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869380.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869380.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869382.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869382.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869386.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869386.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869476.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869476.jpg
--------------------------------------------------------------------------------
/virtual-list/images/1/869508.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/1/869508.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/869510.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/869510.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/869516.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/869516.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/869533.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/869533.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/869541.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/869541.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/869548.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/869548.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/872532.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/872532.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/925010.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/925010.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/925077.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/925077.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/928203.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/928203.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/929016.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/929016.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/930241.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/930241.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/1585264.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/1585264.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/1585360.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/1585360.jpg
--------------------------------------------------------------------------------
/virtual-list/images/2/1641134.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/2/1641134.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/1712289.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/1712289.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/1829772.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/1829772.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2036766.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2036766.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2086307.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2086307.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2091847.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2091847.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2171006.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2171006.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2171910.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2171910.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2187391.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2187391.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2316690.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2316690.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2324402.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2324402.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2325775.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2325775.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2365903.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2365903.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2371520.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2371520.jpg
--------------------------------------------------------------------------------
/virtual-list/images/3/2372627.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/virtual-list/images/3/2372627.jpg
--------------------------------------------------------------------------------
/docs/logo/RxJSplayground-logomark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/docs/logo/RxJSplayground-logomark.png
--------------------------------------------------------------------------------
/docs/logo/RxJSplayground-logotype.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/docs/logo/RxJSplayground-logotype.png
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JayKan/RxJS-Playground/HEAD/react-demos/react-recompoes-demo/public/favicon.ico
--------------------------------------------------------------------------------
/letter-count/custom.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 10px;
3 | font-family: sans-serif;
4 | text-align: center;
5 | background-color: #CCFFCC;
6 | color: #006600;}
7 | }
8 |
9 |
10 |
--------------------------------------------------------------------------------
/canvas-paint/custom.css:
--------------------------------------------------------------------------------
1 | canvas {
2 | background-color: #cccccb;
3 | }
4 |
5 | html {
6 | -moz-user-select: none;
7 | -khtml-user-select: none;
8 | -webkit-user-select: none;
9 | user-select: none;
10 | }
11 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from 'react-dom';
3 | import App from './App';
4 | import './index.css';
5 |
6 | render(
7 | ,
8 | document.getElementById('root')
9 | );
10 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | insert_final_newline = false
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | it('renders without crashing', () => {
6 | const div = document.createElement('div');
7 | ReactDOM.render( , div);
8 | ReactDOM.unmountComponentAtNode(div);
9 | });
10 |
--------------------------------------------------------------------------------
/animation/custom.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 20px;
3 | font-family: 'Helvetica Neue', arial, sans-serif;
4 | color: #333;
5 | }
6 | #drawing {
7 | width: 100%;
8 | height: 400px;
9 | border: #ddd 1px solid;
10 | }
11 | #displayqueue {
12 | text-align: center;
13 | font-family: 'Inconsolata', 'Menlo', 'Courier', monospace;
14 | color: #666;
15 | margin: 20px;
16 | }
17 |
--------------------------------------------------------------------------------
/image-color-selector/style.css:
--------------------------------------------------------------------------------
1 | .actual-color{
2 | height:50px;
3 | width:50px;
4 | }
5 |
6 | #sample{
7 | cursor: crosshair;
8 | }
9 |
10 | .selected-colors{
11 | list-style-type: none;
12 | width:50%;
13 | }
14 |
15 | .selected-colors li{
16 | float: left;
17 | }
18 |
19 | .selected-colors div{
20 | width: 25px;
21 | height: 25px;
22 | margin: 0 10px 10px 0;
23 | }
--------------------------------------------------------------------------------
/drag-drop/custom.css:
--------------------------------------------------------------------------------
1 | #dragTarget {
2 | background-image: url(./logo.png);
3 | background-repeat: no-repeat;
4 | background-position: center;
5 | background-size: contain;
6 | height: 200px;
7 | width: 200px;
8 | background-color: #000000;
9 | border: 1px solid #666666;
10 | color: #ffffff;
11 | padding: 10px;
12 | position: absolute;
13 | cursor: move;
14 | }
15 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/config/jest/fileTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const path = require('path');
4 |
5 | // This is a custom Jest transformer turning file imports into filenames.
6 | // http://facebook.github.io/jest/docs/en/webpack.html
7 |
8 | module.exports = {
9 | process(src, filename) {
10 | return `module.exports = ${JSON.stringify(path.basename(filename))};`;
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // This is a custom Jest transformer turning style imports into empty objects.
4 | // http://facebook.github.io/jest/docs/en/webpack.html
5 |
6 | module.exports = {
7 | process() {
8 | return 'module.exports = {};';
9 | },
10 | getCacheKey() {
11 | // The output is always the same.
12 | return 'cssTransform';
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/infinite-scroll/styles.css:
--------------------------------------------------------------------------------
1 | #infinite-scroller {
2 | height: 500px;
3 | width: 700px;
4 | border: 1px solid #f5ad7c;
5 | overflow: scroll;
6 | padding: 0;
7 | }
8 |
9 | #infinite-scroller li {
10 | padding : 10px 5px;
11 | line-height: 1.5;
12 | }
13 |
14 | #infinite-scroller li:nth-child(odd) {
15 | background : #ffe8d8;
16 | }
17 |
18 | #infinite-scroller li:nth-child(even) {
19 | background : #f5ad7c;
20 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #---------------------------------
2 | # Extensions
3 | #---------------------------------
4 | *.gz
5 | *.log
6 | *.rar
7 | *.tar
8 | *.zip
9 |
10 |
11 | #---------------------------------
12 | # IDE generated
13 | #---------------------------------
14 | .idea/
15 | .project
16 | *.iml
17 |
18 |
19 | #---------------------------------
20 | # OS generated
21 | #---------------------------------
22 | __MACOSX/
23 | .DS_Store
24 | Thumbs.db
25 |
--------------------------------------------------------------------------------
/infinite-scroll/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Naive Infinite Scroll in RxJS
7 |
8 |
9 |
10 | Infinite Scroller for HackerNews titles
11 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/real-time/custom.css:
--------------------------------------------------------------------------------
1 | /* Originally from https://github.com/DanGorst/frp-with-bacon */
2 | h1 {
3 | font-family: 'Helvetica';
4 | font-size: 32px;
5 | }
6 |
7 | h3 {
8 | font-family: 'Helvetica';
9 | font-size: 20px;
10 | }
11 |
12 | text {
13 | font-family: 'Helvetica';
14 | font-size: 16px;
15 | }
16 |
17 | .axis path, .axis line {
18 | fill: none;
19 | stroke: #777;
20 | shape-rendering: crispEdges;
21 | }
22 |
23 | .axis text {
24 | font-family: 'Helvetica';
25 | font-size: 14px;
26 | }
27 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/src/index.css:
--------------------------------------------------------------------------------
1 | *, *:before, *:after {
2 | box-sizing: inherit;
3 | }
4 |
5 | body, input, textarea, select, button {
6 | text-rendering: optimizeLegibility;
7 | -webkit-font-smoothing: antialiased;
8 | -moz-osx-font-smoothing: grayscale;
9 | }
10 |
11 | html, body, #root {
12 | margin: 0;
13 | padding: 0;
14 | height: 100%;
15 | font-weight: 300;
16 | line-height: normal;
17 | box-sizing: content-box;
18 | font-family: 'Pompiere', cursive;
19 | }
20 |
21 | body, #root {
22 | position: relative;
23 | min-height: 100vh;
24 | }
25 |
--------------------------------------------------------------------------------
/mouse-tracking/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | RxJS mouse tracking example
5 |
6 |
7 |
8 |
9 |
10 | Mouse tracking example
11 | Hold mouse button down while moving the mouse and see coordinates
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/follow-the-mouse/custom.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #ffffff;
3 | padding: 10px;
4 | font-family: sans-serif;
5 | }
6 |
7 | li {
8 | padding: 5px;
9 | }
10 |
11 | .contrastBlock {
12 | background-color: #000000;
13 | border: 1px solid #666666;
14 | color: #ffffff;
15 | padding: 10px;
16 | }
17 |
18 | label {
19 | display: block;
20 | padding: 5px;
21 | }
22 | fieldset {
23 | border-style: solid;
24 | border-width: 3px;
25 | }
26 |
27 | .contrastBlock {
28 | position: absolute;
29 | }
30 |
31 | #theTail {
32 | color: #FF0000;
33 | }
34 | #theWagging {
35 | color: #FFFF00;
36 | }
37 |
--------------------------------------------------------------------------------
/crop/custom.css:
--------------------------------------------------------------------------------
1 | #container {
2 | position: relative;
3 | }
4 |
5 | .canvasoverlays {
6 | position: absolute;
7 | }
8 |
9 | .handle {
10 | position: absolute;
11 | width: 20px;
12 | height: 20px;
13 | background-color: rgba(255,255,255,0.5);
14 | border: 1px solid rgba(0,0,0,0.5);
15 | user-select: none;
16 | }
17 |
18 | .handle#tr {
19 | margin-left: -20px;
20 | }
21 |
22 | .handle#t, .handle#b {
23 | margin-left: -10px;
24 | }
25 |
26 | .handle#r, .handle#l {
27 | margin-top: -10px;
28 | }
29 |
30 | .handle#br {
31 | margin-left: -20px;
32 | margin-top: -20px;
33 | }
34 |
35 | .handle#bl {
36 | margin-top: -20px;
37 | }
38 |
--------------------------------------------------------------------------------
/letter-count/custom.js:
--------------------------------------------------------------------------------
1 | ;(function(){
2 |
3 | 'use strict';
4 |
5 | var countElement = document.getElementById('toCount');
6 | var resultElement = document.getElementById('result');
7 | var result2 = document.getElementById('result2');
8 |
9 | var source = Rx.Observable.fromEvent(countElement, 'keyup')
10 | .map(function(e){
11 | return 'length: ' + e.target.value.length;
12 | })
13 | .distinctUntilChanged();
14 |
15 | function setHtml(text){
16 | this.innerHTML = text;
17 | }
18 |
19 | source.subscribe(function(text){
20 | resultElement.innerHTML = text;
21 | });
22 |
23 | source.subscribe( setHtml.bind( result2 ) );
24 |
25 | })();
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Thank you for your interest in contributing! Feel free to put up a PR for any issue or feature request. Please follow blow steps to begin your contribution :)
4 |
5 | ## Setup
6 | 1. `Fork` the repo
7 | 2. `Clone` your fork
8 | 3. Make a branch for your bug fix or adding a new example
9 | 4. Work your magic and make your changes
10 | 5. Commit your changes
11 | 6. Push your branch to your fork
12 | 7. Create a pull request from your branch on your fork to `master` on this repo
13 | 8. Have your branch get merged in and celebrate 🎉 🎊
14 |
15 | If you experience any issues or problems at any point, please don't hesitate to file an issue or send me a message!
--------------------------------------------------------------------------------
/mouse-tracking/script.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | var mouseUpStream = Rx.Observable.fromEvent(document,"mouseup");
3 | var mouseMoveStream = Rx.Observable.fromEvent(document,"mousemove")
4 | .takeUntil(mouseUpStream);
5 |
6 |
7 | var mouseDownStream = Rx.Observable.fromEvent(document,"mousedown")
8 | .flatMap(function(){
9 | return mouseMoveStream;
10 | })
11 | .map(function(event){
12 | return { x: event.clientX, y: event.clientY};
13 | });
14 |
15 | var cntLabel = document.querySelector("h1");
16 |
17 | mouseDownStream.subscribe(function(result){
18 | cntLabel.textContent = "x: " + result.x + " , y: "+ result.y;
19 | });
20 |
21 | }());
--------------------------------------------------------------------------------
/image-color-selector/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 | Image sampler example
13 | Hover image to check color, click on image to add to the samples
14 |
15 |
16 | Hovered color
17 |
18 |
19 |
20 |
21 | Selected color samples
22 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/mario/custom.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Arial;
3 | font-size: 14px;
4 | color: #505050;
5 | padding: 20px;
6 | margin: 0;
7 | background-color: rgba(174, 238, 238, 1);
8 | }
9 |
10 | nav ul {
11 | list-style: none;
12 | margin: 0;
13 | padding: 0;
14 | }
15 |
16 | nav ul li {
17 | margin: 4px 0;
18 | }
19 |
20 | a {
21 | text-decoration: underline;
22 | color: inherit;
23 | text-decoration-style: double;
24 | }
25 |
26 | .arrows-keys {
27 | text-decoration: underline;
28 | text-decoration-style: wavy;
29 | line-height: 1.6;
30 | color: black;
31 | font-size: 15px;
32 | }
33 | #grass {
34 | position: fixed;
35 | background-color: rgba(74, 163, 41, 1);
36 | left: 0;
37 | right: 0;
38 | bottom: 0;
39 | height: 60px;
40 | }
41 |
42 | #mario {
43 | position: fixed;
44 | }
--------------------------------------------------------------------------------
/animation/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | RxJS Animation Test
10 |
11 |
12 |
13 |
14 | RxJS Animation Fun
15 |
16 | [x,y] tuples for each square:
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/scripts/test.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // Do this as the first thing so that any code reading it knows the right env.
4 | process.env.BABEL_ENV = 'test';
5 | process.env.NODE_ENV = 'test';
6 | process.env.PUBLIC_URL = '';
7 |
8 | // Makes the script crash on unhandled rejections instead of silently
9 | // ignoring them. In the future, promise rejections that are not handled will
10 | // terminate the Node.js process with a non-zero exit code.
11 | process.on('unhandledRejection', err => {
12 | throw err;
13 | });
14 |
15 | // Ensure environment variables are read.
16 | require('../config/env');
17 |
18 | const jest = require('jest');
19 | let argv = process.argv.slice(2);
20 |
21 | // Watch unless on CI or in coverage mode
22 | if (!process.env.CI && argv.indexOf('--coverage') < 0) {
23 | argv.push('--watch');
24 | }
25 |
26 |
27 | jest.run(argv);
28 |
--------------------------------------------------------------------------------
/letter-count/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | RxJS Simple Letter Count Example
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
Text buffer:
18 |
Start Typing!
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/real-time/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | d3 Real-time with RxJS Fun!
9 |
10 |
11 |
12 |
13 | Wikipedia Updates using RxJS
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/config/polyfills.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | if (typeof Promise === 'undefined') {
4 | // Rejection tracking prevents a common issue where React gets into an
5 | // inconsistent state due to an error, but it gets swallowed by a Promise,
6 | // and the user has no idea what causes React's erratic future behavior.
7 | require('promise/lib/rejection-tracking').enable();
8 | window.Promise = require('promise/lib/es6-extensions.js');
9 | }
10 |
11 | // fetch() polyfill for making API calls.
12 | require('whatwg-fetch');
13 |
14 | // Object.assign() is commonly used with React.
15 | // It will use the native implementation if it's present and isn't buggy.
16 | Object.assign = require('object-assign');
17 |
18 | // In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
19 | // We don't polyfill it in the browser--this is user's responsibility.
20 | if (process.env.NODE_ENV === 'test') {
21 | require('raf').polyfill(global);
22 | }
23 |
--------------------------------------------------------------------------------
/drag-drop/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | RxJS Drag and Drop Example!
10 |
11 |
12 |
13 |
14 |
15 |
16 | Drag Me!
17 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docs/logo/License:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Baran Pirinçal
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/virtual-list/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | /*overflow: hidden;*/
3 | }
4 |
5 | .border {
6 | border: 1px solid black;
7 | }
8 |
9 | .outer {
10 | overflow: hidden;
11 | /*overflow: none;*/
12 | position: absolute;
13 | left: 0;
14 | right: 0;
15 | top: 50%;
16 | margin-top: -85px;
17 | height: 170px;
18 | }
19 |
20 | .inner {
21 | position: absolute;
22 | overflow: none;
23 | box-sizing: border-box;
24 | border-color: red;
25 | border-width: 2px;
26 | left: 0;
27 | right: 0;
28 | top: 20px;
29 | bottom: 15px;
30 | padding: 5px 0 5px 0;
31 | transform-style: preserve-3d;
32 | transform: translate3d(0, 0, 0);
33 | -webkit-transform: translate3d(0, 0, 0);
34 | white-space: nowrap;
35 | }
36 |
37 | .box-art {
38 | box-sizing: border-box;
39 | display: inline-block;
40 | background-repeat: no-repeat;
41 | margin: 0 5px 0 5px;
42 | width: 90px;
43 | height: 120px;
44 | }
45 |
46 | .box-art img {
47 | position: absolute;
48 | width: 90px;
49 | height: 120px;
50 | pointer-events: none;
51 | }
52 |
--------------------------------------------------------------------------------
/mario/polyfills.js:
--------------------------------------------------------------------------------
1 | ;(function () {
2 | 'use strict';
3 |
4 | if (!Object.assign) {
5 | Object.defineProperty(Object, "assign", {
6 | enumerable: false,
7 | configurable: true,
8 | writable: true,
9 | value: function(target, firstSource) {
10 | "use strict";
11 | if (target === undefined || target === null) {
12 | throw new TypeError("Cannot convert first argument to object");
13 | }
14 | var to = Object(target);
15 | for (var i = 1; i < arguments.length; i++) {
16 | var nextSource = arguments[i];
17 | if (nextSource === undefined || nextSource === null) continue;
18 | var keysArray = Object.keys(Object(nextSource));
19 | for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
20 | var nextKey = keysArray[nextIndex];
21 | var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
22 | if (desc !== undefined && desc.enumerable) { to[nextKey] = nextSource[nextKey]; }
23 | }
24 | }
25 | return to;
26 | }
27 | });
28 | }
29 | }());
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2019 Jay Kan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/follow-the-mouse/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Rx for JavaScript Rocks!
10 |
11 |
12 |
13 |
14 |
15 |
16 | the mouse!
17 | its tail!
18 | is happy!
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/virtual-list/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/canvas-paint/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | RxJS Canvas Paint Example Rocks!
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/crop/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Rx for JavaScript Rocks!
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/src/App.js:
--------------------------------------------------------------------------------
1 | // import React from 'react';
2 | // import { Observable } from 'rxjs';
3 | // import config from 'recompose/rxjsObservableConfig';
4 | // import {
5 | // setObservableConfig,
6 | // componentFromStream
7 | // } from 'recompose';
8 |
9 | // setObservableConfig(config);
10 |
11 | // // class App extends Component {
12 | // // render() {
13 | // // return (
14 | // //
15 | // //
16 | // // Hello World
17 | // //
18 | // //
19 | // // );
20 | // // }
21 | // // }
22 |
23 | // const App = componentFromStream(props$ => {
24 | // return Observable.interval(1000).map(i => (
25 | // {i}
26 | // ));
27 | // });
28 |
29 | // export default App;
30 | import React from "react"
31 | import { render } from "react-dom"
32 | import { Observable } from "rxjs"
33 | import config from "recompose/rxjsObservableConfig"
34 | import {
35 | setObservableConfig,
36 | componentFromStream
37 | } from "recompose"
38 |
39 | setObservableConfig(config)
40 |
41 | const App = componentFromStream(props$ => {
42 | return Observable.interval(1000).map(i => (
43 | {i}
44 | ))
45 | })
46 |
47 | export default App;
48 |
--------------------------------------------------------------------------------
/smart-counter/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Smart Counter in Rx5
7 |
37 |
38 |
39 |
40 |
41 |
42 |
Smoothly transitions numbers with ease!
43 |
44 | Update
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/mario/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Mario in RxJS Rocks!
10 |
11 |
12 |
13 |
14 |
15 |
RxJS - Mario
16 |
Originally was developed by Daniel Fudala on GitHub
17 |
Use arrow keys (←, →, ↑, ↓) to move around your Mario!
18 |
View Source Source
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/debt-calculator/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Simple Debt Calculator
10 |
11 |
12 |
13 |
14 |
15 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/smart-counter/index.js:
--------------------------------------------------------------------------------
1 | ;(function () {
2 | 'use strict';
3 |
4 | var input = document.getElementById('range');
5 | var updateButton = document.getElementById('update');
6 |
7 | // Utility functions
8 | function takeUntilFunc(endRange, currentNumber) {
9 | return endRange > currentNumber
10 | ? function (val) { return val <= endRange; }
11 | : function (val) { return val >= endRange; }
12 | }
13 |
14 | function positiveOrNegative(endRange, currentNumber) {
15 | return endRange > currentNumber ? 1 : -1;
16 | }
17 |
18 | function updateHTML(id) {
19 | return function (val) {
20 | return document.getElementById(id).innerHTML = val;
21 | };
22 | }
23 |
24 | // Creating subscription
25 | var subscription = (function(currentNumber) {
26 | return Rx.Observable
27 | .fromEvent(updateButton, 'click')
28 | .map(function() { return parseInt(input.value); })
29 | .switchMap(function(endRange) {
30 | return Rx.Observable.timer(0, 20)
31 | .mapTo(positiveOrNegative(endRange, currentNumber))
32 | .startWith(currentNumber)
33 | .scan(function(acc, curr) {
34 | return acc + curr;
35 | })
36 | .takeWhile(takeUntilFunc(endRange, currentNumber));
37 | })
38 | .do(function(v) {
39 | return currentNumber = v;
40 | })
41 | .startWith(currentNumber)
42 | .subscribe(updateHTML('display'));
43 | })(0);
44 | })();
--------------------------------------------------------------------------------
/drag-drop/dragdrop.js:
--------------------------------------------------------------------------------
1 | ;(function(){
2 |
3 | 'use strict';
4 |
5 | function main () {
6 |
7 | var targetElement = document.getElementById('dragTarget');
8 |
9 | /*
10 | Get the three major mouseEvents we'll be observing.
11 | */
12 | var mouseUp = Rx.Observable.fromEvent( targetElement, 'mouseup' );
13 | var mouseMove = Rx.Observable.fromEvent( document, 'mousemove' );
14 | var mouseDown = Rx.Observable.fromEvent( targetElement, 'mousedown' );
15 |
16 | var mouseDrag = mouseDown.flatMap(function (md) {
17 |
18 | /*
19 | Calculates the offsets when mouse starting moving down
20 | */
21 | var startX = md.offsetX,
22 | startY = md.offsetY;
23 |
24 | /*
25 | Calculates delta with mouseMove events
26 | until mouseUp events are done.
27 | */
28 | return mouseMove.map(function (mm) {
29 | mm.preventDefault();
30 |
31 | return {
32 | left: mm.clientX - startX,
33 | top: mm.clientY - startY
34 | };
35 | }).takeUntil(mouseUp);
36 | });
37 |
38 | function updateElementPosition(position){
39 | this.style.top = position.top + 'px';
40 | this.style.left = position.left + 'px';
41 | }
42 |
43 | /*
44 | Updates drag&drop Element position.
45 | */
46 | mouseDrag.subscribe(
47 | updateElementPosition.bind( targetElement )
48 | );
49 | }
50 |
51 | main();
52 |
53 | })();
--------------------------------------------------------------------------------
/typehead/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | RxJS TypeHead Example
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
32 |
33 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/dynamic-render/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Dynamic Rendering Widget Demo
7 |
12 |
13 |
14 |
15 |
16 | Points
17 |
18 |
19 |
20 |
21 |
22 | Outer Radius
23 |
24 |
25 |
26 |
27 |
28 | Inner Radius
29 |
30 |
31 |
32 |
33 |
34 | Clockwise
35 |
36 |
37 |
38 |
39 |
40 | Line width
41 |
42 |
43 |
44 |
45 |
46 | Stoke Color
47 |
48 |
49 |
50 |
51 |
52 | Fill Color
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/data-binding/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Rx for JavaScript Rocks!
10 |
11 |
12 |
13 |
14 |
15 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/follow-the-mouse/custom.js:
--------------------------------------------------------------------------------
1 | ;(function(){
2 |
3 | 'use strict';
4 |
5 | function extractClientX(e) { return e.clientX; }
6 | function extractClientY(e) { return e.clientY; }
7 | function setLeft(x) { this.style.left = x + 'px'; }
8 | function setTop(y) { this.style.top = y + 'px'; }
9 | function add(x, y) { return x + y }
10 | function partialAdd(x) { return add.bind(null, x); }
11 | function randomize() { return Math.round(10 * Math.random() -5); }
12 |
13 | var delay = 300;
14 |
15 | var mouseMove = Rx.Observable.fromEvent(document, 'mousemove');
16 | var left = mouseMove.map(extractClientX);
17 | var top = mouseMove.map(extractClientY);
18 |
19 | // Update the mouse
20 | var theMouse = document.querySelector('#theMouse');
21 | left.subscribe(setLeft.bind(theMouse));
22 | top.subscribe(setTop.bind(theMouse));
23 |
24 | // Update the tail
25 | var mouseOffset = theMouse.offsetWidth;
26 | var theTail = document.querySelector('#theTail');
27 | left
28 | .map(partialAdd(mouseOffset))
29 | .delay(delay)
30 | .subscribe(setLeft.bind(theTail))
31 | ;
32 | top
33 | .delay(delay)
34 | .subscribe(setTop.bind(theTail))
35 | ;
36 |
37 | // Update the wagging
38 | var wagDelay = delay * 1.5;
39 | var wagging = document.querySelector('#theWagging');
40 | var mouseAndTailOffset = mouseOffset + theTail.offsetWidth;
41 | left
42 | .map(partialAdd(mouseAndTailOffset))
43 | .delay(wagDelay)
44 | .subscribe(setLeft.bind(wagging))
45 | ;
46 | var waggingDelay = Rx.Observable
47 | .interval(100)
48 | .map(randomize)
49 | ;
50 |
51 | top
52 | .delay(wagDelay)
53 | .combineLatest(waggingDelay, add)
54 | .subscribe(setTop.bind(wagging))
55 | ;
56 |
57 | })();
--------------------------------------------------------------------------------
/docs/OBSERVABLE_PIPELINE.md:
--------------------------------------------------------------------------------
1 | # Observable Pipeline
2 | > An Observable pipeline is a technique that combines a group of operators chained together, where each one takes an Observable as input and returns an Observable as output.
3 |
4 | ### Pipeline Example
5 | ```javascript
6 | Rx.Observable
7 | .from(1, 2, 3, 4, 5, 6, 7, 8)
8 | .filter(function(val) { return val % 2 })
9 | .map(function(val) { return val * 10 });
10 | ```
11 | Pipelines are self-contained. All state flows from one operator to the next, without the need for any external variables. As a result, the operators in a pipeline should always use pure functions to avoid any side effects.
12 |
13 | Pure functions always return the same output given the same input. It's easier to design programs with high concurrency when we can guarantee that a function in the program can't modify state other functions rely on.
14 |
15 | ### Pipelines are efficient
16 | ```javascript
17 | stringObservalbe // represents an observable emitting 1,000 strings
18 | .map(function(str) {
19 | return str.toUpperCase();
20 | })
21 | .filter(function(str) {
22 | return /^[A-Z]+$/.test(str);
23 | })
24 | .subscribe(function(str) {
25 | console.log(str);
26 | });
27 | ```
28 |
29 | Observable pipelines look extremely similar to array chains, but their similarities end here. In an Observable, nothing ever happens until we **subscribe** to it, no matter how many queries and transformations we apply to it. When we chain a transformation like *map*, we're composing a single function that will operate on every item of the array once.
30 |
31 | With Observables, we'll ONLY go through our array list once, and we'll apply the transformations only if absolutely required. This way of operating is called *lazy evaluation*, and it is very common in functional languages such as Haskell and Miranda.
32 |
33 |
--------------------------------------------------------------------------------
/docs/rxjs_ng_europe.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | function map(transformFn) {
4 | const inputObservable = this;
5 | const outputObservable = createObservable(function subscribe(outputObserver) {
6 | inputObservable.subscribe({
7 | next: function(x) {
8 | const y = transformFn(x);
9 | outputObserver.next(y);
10 | },
11 | error: function(e) {
12 | outputObserver.error(e);
13 | },
14 | complete: function () {
15 | outputObserver.complete();
16 | }
17 | })
18 | });
19 | return outputObservable;
20 | }
21 |
22 | function filter(conditionFn) {
23 | const inputObservable = this;
24 | const outputObservable = createObservable(function subscribe(outputObserver) {
25 | inputObservable.subscribe({
26 | next: function(x) {
27 | if (conditionFn(x)) {
28 | outputObserver.next(x);
29 | }
30 | },
31 | error: function(e) {
32 | outputObserver.error(e);
33 | },
34 | complete: function () {
35 | outputObserver.complete();
36 | }
37 | })
38 | });
39 | return outputObservable;
40 | }
41 |
42 |
43 | function createObservable(subscribe) {
44 | return {
45 | subscribe: subscribe,
46 | map: map,
47 | filter: filter
48 | };
49 | }
50 |
51 | const arrayObservable = createObservable(function(observer) {
52 | [10, 20, 30].forEach(observer.next);
53 | observer.complete();
54 | });
55 |
56 | const observer = {
57 | next: function nextCallback(data) {
58 | console.log(data);
59 | },
60 | error: function errorCallback(err) {
61 | console.error(err);
62 | },
63 | complete: function completeCallback() {
64 | console.log('done');
65 | }
66 | };
67 |
68 |
69 | arrayObservable
70 | .map(function(x) { return x / 10; })
71 | .filter(function (x) { return x !== 2; })
72 | .subscribe(observer);
73 |
74 |
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
23 | React App
24 |
25 |
26 |
27 | You need to enable JavaScript to run this app.
28 |
29 |
30 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/image-color-selector/script.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | // find DOM elements
3 | var sampleImage = document.querySelector("#sample");
4 | var selectedColorsList = document.querySelector(".selected-colors");
5 | var actualColorDiv = document.querySelector(".actual-color");
6 | var actualColorLabel = document.querySelector(".actual-color-label");
7 | var canvas = document.createElement("canvas");
8 |
9 | init();
10 |
11 | var mouseMoveStream = Rx.Observable.fromEvent(sampleImage, "mousemove")
12 | .map(retrieveColorFromEvent);
13 |
14 | var clickStream = Rx.Observable.fromEvent(sampleImage, "mousedown")
15 | .map(retrieveColorFromEvent).distinctUntilChanged();
16 |
17 | mouseMoveStream.subscribe(function (color) {
18 | addActualColor(color);
19 | });
20 |
21 | clickStream.subscribe(function (color) {
22 | addSelectedColor(color);
23 | });
24 |
25 | function init(){
26 | canvas.width = sampleImage.clientWidth;
27 | canvas.height = sampleImage.clientHeight;
28 | }
29 |
30 | function retrieveColorFromEvent(event) {
31 | var point = {
32 | x: event.offsetX,
33 | y: event.offsetY
34 | };
35 |
36 | canvas.getContext('2d').drawImage(sampleImage, 0, 0, canvas.width, canvas.height);
37 | var pixelData = canvas.getContext('2d').getImageData(point.x, point.y, 1, 1).data;
38 |
39 | return "rgba(" + pixelData[0] + "," + pixelData[1] + "," + pixelData[2] + "," + pixelData[3] / 255 + ")";
40 | }
41 |
42 | function addActualColor(color) {
43 | actualColorDiv.style.backgroundColor = color;
44 | actualColorLabel.innerHTML = color;
45 | }
46 |
47 | function addSelectedColor(color) {
48 | selectedColorsList.innerHTML += '
';
49 | }
50 | }());
51 |
--------------------------------------------------------------------------------
/infinite-scroll/index.js:
--------------------------------------------------------------------------------
1 | ;(function() {
2 | 'use strict';
3 |
4 | var currentPage = 1;
5 | var scrollElem = document.getElementById('infinite-scroller');
6 | var scrollEvent$ = Rx.Observable.fromEvent(scrollElem, 'scroll');
7 |
8 | function getQuotesAPI() {
9 | return 'https://node-hnapi.herokuapp.com/news?page=' + currentPage;
10 | }
11 |
12 | // Check if the user is scrolling down by previous
13 | // scroll position and current scroll position
14 | function isUserScrollingDown(positions) {
15 | return positions[0].sT < positions[1].sT
16 | }
17 |
18 | // Check if the scroll position at required percentage
19 | function isScrollExpectedPercent(position, percent) {
20 | return ((position.sT + position.cH) / position.sH) > (percent / 100);
21 | }
22 |
23 | // Render each news on the view
24 | function renderNews(news) {
25 | var li = document.createElement('li');
26 | li.innerHTML = [news.id, news.title].join(' - ');
27 | scrollElem.appendChild(li);
28 | }
29 |
30 | // Process data returned from api
31 | function processData(res) {
32 | res.json()
33 | .then(function (news) {
34 | currentPage++;
35 | news.forEach(renderNews);
36 | });
37 | }
38 |
39 | // User scroll down stream
40 | var userScrolledDown$ = scrollEvent$
41 | .map(function (e) {
42 | return {
43 | sH: e.target.scrollHeight,
44 | sT: e.target.scrollTop,
45 | cH: e.target.clientHeight
46 | };
47 | })
48 | .pairwise()
49 | .filter(function (positions) {
50 | return isUserScrollingDown(positions) && isScrollExpectedPercent(positions[1], 70);
51 | });
52 |
53 | var requestOnScroll$ = userScrolledDown$
54 | .startWith([])
55 | .exhaustMap(function () {
56 | return Rx.Observable.fromPromise(fetch(getQuotesAPI()))
57 | });
58 |
59 |
60 | // Subscribe and apply effects
61 | requestOnScroll$.subscribe(processData);
62 |
63 | })();
--------------------------------------------------------------------------------
/canvas-paint/custom.js:
--------------------------------------------------------------------------------
1 | ;(function(window, undefined) {
2 | 'use strict';
3 |
4 | /**
5 | * @kind function
6 | * @name getOffset
7 | * @param event
8 | * @description Calculate offset either layerX/Y or offsetX/Y
9 | */
10 | function getOffset(event) {
11 | return {
12 | offsetX: event.offsetX === undefined ? event.layerX : event.offsetX,
13 | offsetY: event.offsetY === undefined ? event.layerY : event.offsetY
14 | };
15 | }
16 |
17 | function bootstrap() {
18 | var canvas = document.getElementById('tutorial'),
19 | move, down, up, context;
20 |
21 | if (canvas.getContext) {
22 | context = canvas.getContext('2d');
23 | context.beginPath();
24 |
25 | // check for pinter events
26 | if (window.navigator.pointerEnabled) {
27 | move = 'pointermove';
28 | down = 'pointerdown';
29 | up = 'pointerup';
30 | } else {
31 | move = 'mousemove';
32 | down = 'mousedown';
33 | up = 'mouseup';
34 | }
35 |
36 | // Get mouse moves.
37 | var mouseMoves = Rx.Observable.fromEvent(canvas, move);
38 |
39 | // Calculate the difference between two mouse moves.
40 | var mouseDelta = mouseMoves.zip(mouseMoves.skip(1), function(fst, snd) {
41 | return { first: getOffset(fst), second: getOffset(snd) };
42 | });
43 |
44 | // Merge together both mouse up and mouse down events.
45 | var mouseButton = Rx.Observable.fromEvent(canvas, down)
46 | .map(function() {
47 | return true;
48 | })
49 | .merge(Rx.Observable.fromEvent(canvas,up).map(function() {
50 | return false;
51 | }));
52 |
53 | // Paint if the mouse is down.
54 | var paint = mouseButton.flatMapLatest(function(down) {
55 | return down ? mouseDelta : mouseDelta.take(0);
56 | });
57 |
58 | // Update the canvas.
59 | paint.subscribe(function(x) {
60 | context.moveTo(x.first.offsetX, x.first.offsetY);
61 | context.lineTo(x.second.offsetX, x.second.offsetY);
62 | context.stroke();
63 | });
64 | }
65 | }
66 |
67 | window.onload = function() {
68 | bootstrap();
69 | }
70 |
71 | })(window);
--------------------------------------------------------------------------------
/react-demos/react-recompoes-demo/config/paths.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const path = require('path');
4 | const fs = require('fs');
5 | const url = require('url');
6 |
7 | // Make sure any symlinks in the project folder are resolved:
8 | // https://github.com/facebookincubator/create-react-app/issues/637
9 | const appDirectory = fs.realpathSync(process.cwd());
10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
11 |
12 | const envPublicUrl = process.env.PUBLIC_URL;
13 |
14 | function ensureSlash(path, needsSlash) {
15 | const hasSlash = path.endsWith('/');
16 | if (hasSlash && !needsSlash) {
17 | return path.substr(path, path.length - 1);
18 | } else if (!hasSlash && needsSlash) {
19 | return `${path}/`;
20 | } else {
21 | return path;
22 | }
23 | }
24 |
25 | const getPublicUrl = appPackageJson =>
26 | envPublicUrl || require(appPackageJson).homepage;
27 |
28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer
29 | // "public path" at which the app is served.
30 | // Webpack needs to know it to put the right
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |