Skip to content
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

T32139 default negative ids for new models #112

Open
wants to merge 54 commits into
base: health_master
Choose a base branch
from

Conversation

robinzelders
Copy link
Contributor

This changes mobx-spine to automatically set negative ids for new models, it will also create a new negative id on every clear

src/Model.js Outdated Show resolved Hide resolved
src/__tests__/Model.js Outdated Show resolved Hide resolved
Copy link
Contributor

@abzainuddin abzainuddin left a comment

Choose a reason for hiding this comment

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

TODO:

  • Fix small typo
  • Add documentation about when negative ids are supplied, and what now null means, and when isNew return true

@@ -925,7 +926,7 @@ var Model = (_class$1 = (_temp$1 = _class2$1 = function () {

/**
* A model is considered new if it does not have an id, or if the id is a negative integer.
* @returns {boolean} True if the model id is not set or a negative integer
* @returns {boolean} - True if the model id is not set or a negative integer
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo?

robin and others added 8 commits February 28, 2022 14:42
…egative-ids-for-new-models # Conflicts: # dist/mobx-spine.cjs.js # dist/mobx-spine.es.js # package.json # src/__tests__/Model.js

 Ref T32139
…egative-ids-for-new-models # Conflicts: # src/__tests__/Model.js

 Ref T32139
 Ref T32139
@codecov-commenter
Copy link

Codecov Report

Merging #112 (3f916bb) into health_master (8d72cc2) will increase coverage by 0.20%.
The diff coverage is 96.29%.

❗ Current head 3f916bb differs from pull request most recent head 126db33. Consider uploading reports for the commit 126db33 to get more accurate results

Impacted file tree graph

@@                Coverage Diff                @@
##           health_master     #112      +/-   ##
=================================================
+ Coverage          93.38%   93.59%   +0.20%     
=================================================
  Files                  5        5              
  Lines                862      843      -19     
  Branches             206      200       -6     
=================================================
- Hits                 805      789      -16     
+ Misses                47       44       -3     
  Partials              10       10              
Impacted Files Coverage Δ
src/Model.js 90.90% <ø> (-0.04%) ⬇️
src/BinderApi.js 99.19% <96.29%> (-0.81%) ⬇️

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 8d72cc2...126db33. Read the comment docs.

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.

5 participants