Skip to content

Add methods addAll, addAllUnique and removeAll #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 23, 2017
Merged

Add methods addAll, addAllUnique and removeAll #459

merged 5 commits into from
Jul 23, 2017

Conversation

arniu
Copy link
Contributor

@arniu arniu commented Jul 8, 2017

No description provided.

Copy link
Contributor

@flovilmart flovilmart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add new tests instead of altering existing ones?

@codecov
Copy link

codecov bot commented Jul 9, 2017

Codecov Report

Merging #459 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
+ Coverage   85.39%   85.41%   +0.02%     
==========================================
  Files          46       46              
  Lines        3724     3730       +6     
  Branches      854      854              
==========================================
+ Hits         3180     3186       +6     
  Misses        544      544
Impacted Files Coverage Δ
src/ParseObject.js 86.55% <100%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c8cb6f...65eac16. Read the comment docs.

@flovilmart
Copy link
Contributor

@arniu on the implementation side, those all all the same as add, addUnique, remove etc... Why not just change the accepted type to mixed | Array<mixed> as it is the same underlying implementation.

@arniu
Copy link
Contributor Author

arniu commented Jul 10, 2017

@flovilmart This is mainly due to compatibility considerations:

  1. Keep the API consistent with other SDK's;
  2. Keep backward compatible.

In the old version, you can use add to add tuples to the array. For example,

var obj = new Parse.Object('TestObject')
obj.add('array', [1, 2])
obj.add('array', [1, 2])

The result is [[1, 2], [1, 2]].

If you allow add batch to add objects, the result will be [1, 2, 1, 2].

@flovilmart
Copy link
Contributor

My bad, I misread the code, as it looked very similar :)

@flovilmart flovilmart merged commit af28f27 into parse-community:master Jul 23, 2017
flovilmart pushed a commit that referenced this pull request Aug 30, 2017
* Add Type Polygon to Schema and PolygonContains to query

* Corrects Guide Link in README.md (#457)

Just a small fix of `https` to `http` for the JS guide link, which is only available over `http`.

* Addresses flaky test (#458)

* Update ParseGeoPointTest.js

* Limit request attempts to 1

* explore

* Marks flaky test as pending

* Add methods `addAll`, `addAllUnique` and `removeAll` (#459)

* Add methods `addAll`, `addAllUnique` and `removeAll`

* Add methods `addAll`, `addAllUnique` and `removeAll`

* Add test for `addAll`, `addAllUnique` and `removeAll`

* Revert test case

* containsPoint

uses bounded box first then ray casting

* update parse-server to 2.6.0

* Add Type Polygon to Schema and PolygonContains to query

* containsPoint

uses bounded box first then ray casting

* update parse-server to 2.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants