React Native ImmutableJS ListView Part 2

const ds = new ListView.DataSource({
rowHasChanged: (r1, r2) => r1 !== r2,
getRowData: (dataBlob, sID, rID) => dataBlob[sID].get(rID)
});
ds.cloneWithRows(rows, rows.keySeq().toArray())

ListView.DataSource is a complicated beast, below is my second attempt at making it play nicely with ImmutableJS.

Library

I’ve wrapped this up in a npm module https://github.com/DaleJefferson/react-native-immutable-listview-datasource

Install

npm install --save react-native-immutable-listview-datasource

Usage

const ds = new ImmutableDataSource()
this.state = {
dataSource: ds.cloneWithRows(rows)
}

Part 1, now outdated https://medium.com/@dalejefferson/react-native-immutable-listview-example-78662fa64a15#.y5mbugs7g