Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis

gdyrrahitis/rxjs.js Secret

Created Jul 10, 2019
Embed
What would you like to do?
const { of } = require('rxjs');
const { map } = require('rxjs/operators');
const append = (text) => map(x => x + text);
const removeTheLetter = (letter) => map(x =>
x.split('')
.filter(c => c !== letter)
.join(''));
const makeLetterUpperCase = (letter) => map(x =>
x.split('')
.map(c => c === letter ? c.toUpperCase() : c)
.join(''));
const removeWordsWithLessThanFourLetters = map(x =>
x.split(' ')
.filter(word => word.length > 4)
.join(' '));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.