ohanhi / elm-native-ui

[CLOSED] Experiment: mobile apps in Elm using React Native.
BSD 3-Clause "New" or "Revised" License
1.54k stars 76 forks source link

Swap order of arguments for ListView.updateDataSource #71

Closed Janiczek closed 7 years ago

Janiczek commented 7 years ago

This seems like an idiomatic way to write the updateDataSource:

ListView.emptyDataSource
    |> ListView.updateDataSource [ 1, 2, 3 ]

but right now we can't do that - the data source has to be the first argument, so the best the user can currently do is to flip the function.

(This is similar to the *.andThen debate and BC change in elm-lang/core not so long ago).

ohanhi commented 7 years ago

Hi, I agree with your reasoning. The data operated on should be the last argument to the function. I'd be up for a PR on this, if you'd like to contribute!