bamlab / bamlab/react-native-components-collection

[react-native-map-clustering] Some things that would make this library easier to use

Open
#23 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
39
Forks
6
PR merge metrics
No merged PRs in 30d

Description

I'm going to dump a few ideas here, you can always divide it out into separate issues if you want to track them easier.

# Non-breaking Changes

## Update the documentation

- There is no basic usage example in the README file.
- There is nothing that mentions this is a replacement/wrapper around react-native-map. Again, a basic usage would probably handle that if you had a before & after snippet comparison.

## Remove the full lodash package

- lodash is great, but it's also huge. You are _only_ using the throttle method. Why not [import only lodash throttle](https://www.npmjs.com/package/lodash.throttle)? That'll reduce the dependency tree, and make it clear what parts of lodash you are actually using.

## Add tests

- I will _almost_ never bring in a package that doesn't have tests. I can't trust a package to work if there are no guarantees in the code.

# Breaking Changes

## Export as a HoF wrapper

- In the app's current state, you are essentially hard-coding the relationship between your wrapper around maps - you could just export it as a function wrapper that augments RNMapView, something like `withClustering(RNMapView)`.
- This should make testing easier, too, since the component wrapper is completely separate from the RNMapView implementation.
- This should make any upgrading from react-native-maps side incredibly easy, since it puts responsibility on the end-developer rather than on you.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.