Closed sujameslin closed 6 years ago
Sure, I'd happily accept a PR to support seamless-immutable
!
The offending line of code is at https://github.com/cooperka/react-native-immutable-list-view/blob/master@{2017-12-04}/src/utils.js#L63, because seamless
doesn't implement the isEmpty
method.
In lieu of a PR, you could work around this yourself by doing something like the following, as an example:
import lodash from 'lodash';
import Immutable from 'seamless-immutable';
myObject = Immutable([1, 2, 3]);
myObject.isEmpty = lodash.isEmpty.bind(null, myObject);
or go even further and define it automatically for your app (note this example is untested):
import lodash from 'lodash';
import Immutable from 'seamless-immutable';
const originalImmutable = Immutable;
const customImmutable = (object) => {
immutableObject = originalImmutable(object);
immutableObject.isEmpty = lodash.isEmpty.bind(null, myObject);
return immutableObject;
};
export default customImmutable;
As a follow-up question, the point of seamless-immutable
is so you don't need to use libraries like immutable-list-view
; why not use a regular ListView
?
Closing due to inactivity.
For now, i can't use this component with
seamless-immutable
. I'm gettingimmutableData.isEmpty
is not defined error. Sinceseemless-immutable
is also widely used immutable library, can we also support this?