Profile cover photo
Profile photo
Benjamin
367 followers -
I love coding
I love coding

367 followers
About
Posts

Post has attachment
Functional sequences for processing iterable data in JavaScript - inspired by Kotlin Sequences.

asSequence(persons)
.filterNot(it => it.age < 18)
.flatMap(it => asSequence(it.children))
.distinctBy(it => it.lastName)
.sortedBy(it => it.firstName)
.take(10)
.toArray();
Add a comment...

Post has attachment
Expekt is a (work in progress) BDD assertion library for #Kotlin, inspired by Chai.js. It works with your favorite test runner such as #JUnit and Spek.
winterbe/expekt
winterbe/expekt
github.com
Add a comment...

Post has attachment
A filterable and sortable #ReactJS table component example: 

https://github.com/winterbe/react-samples
Animated Photo
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Stream.js 1.6.2 adds support for streaming #Java 8 lists from #JavaScript via #Nashorn

Example:

load('./stream.js');

var list = new java.util.ArrayList();
list.add(1);
list.add(2);
list.add(3);

Stream(list)
    .filter(function (num) {
        return num % 2 === 1;
    })
    .forEach(function (num) {
        print(num);    // 1, 3
    });
Add a comment...

Post has attachment
Stream.js 1.6.0 released with #ES6  support:

function* fibonacci() {
    let [prev, cur] = [0, 1];
    while (true) {
        [prev, cur] = [cur, prev + cur];
        yield cur;
    }
}

Stream(fibonacci())
    .filter(n => n % 2)
    .takeWhile(n => n < 50)
    .toArray();      // 1, 3, 5, 13, 21
Add a comment...

Post has attachment
Stream.js 1.4.0 is available... #JavaScript 
Add a comment...

Post has attachment

Post has attachment

Post has attachment
Add a comment...
Wait while more posts are being loaded