RxJS 5 Operators By Example
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
/* This can be the start of a module */ | |
const makeHandler = cb => { | |
return { | |
get (object, prop, receiver) { | |
if (Reflect.has(object, prop)) { | |
return Reflect.get(...arguments) | |
} | |
return new Proxy(() => {}, { |
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import MyComponent from '../src/my-component'; | |
const wrapper = shallow(<MyComponent/>); | |
describe('(Component) MyComponent', () => { | |
it('renders without exploding', () => { | |
expect(wrapper).to.have.length(1); | |
}); |
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
const I = x => x; | |
const K = x => y => x; | |
const A = f => x => f(x); | |
const T = x => f => f(x); | |
const W = f => x => f(x)(x); | |
const C = f => y => x => f(x)(y); | |
const B = f => g => x => f(g(x)); | |
const S = f => g => x => f(x)(g(x)); | |
const P = f => g => x => y => f(g(x))(g(y)); | |
const Y = f => (g => g(g))(g => f(x => g(g)(x))); |
class BerlinClock | |
SECONDS = "Y" | |
HOURS_FIVES = "RRRR" | |
HOURS_ONES = "RRRR" | |
MINUTES_FIVES = "YYRYYRYYRYY" | |
MINUTES_ONES = "YYYY" | |
def initialize(h,m,s) | |
@h, @m, @s = h, m, s | |
end |