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

feat: EquatableConfig for global stringify configuration #69

Merged
merged 1 commit into from
May 29, 2020
Merged

Conversation

felangel
Copy link
Owner

Status

READY

Breaking Changes

NO

Description

Addresses #68 #60 #65

stringify can be configured globally for all Equatable instances via EquatableConfig

EquatableConfig.stringify = true;

If stringify is overridden for a specific Equatable class, then the value of EquatableConfig.stringify is ignored.
In other words, the local configuration always takes precedence over the global configuration.

Todos

  • Tests
  • Documentation
  • Examples

Impact to Remaining Code Base

New feature which will be included in v1.2.0 of Equatable.

@felangel felangel self-assigned this May 29, 2020
@felangel felangel added the enhancement New feature or request label May 29, 2020
This was linked to issues May 29, 2020
@codecov-commenter
Copy link

codecov-commenter commented May 29, 2020

Codecov Report

Merging #69 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #69   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           45        59   +14     
=========================================
+ Hits            45        59   +14     
Impacted Files Coverage Δ
lib/src/equatable.dart 100.00% <100.00%> (ø)
lib/src/equatable_mixin.dart 100.00% <100.00%> (ø)

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 29325c1...72e9110. Read the comment docs.

Copy link

@jorgecoca jorgecoca left a comment

Choose a reason for hiding this comment

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

LGTM! I think this is going to enable so many other features! 🚢

@felangel felangel merged commit a4f1ec4 into master May 29, 2020
@felangel felangel deleted the v1.2.0 branch May 29, 2020 16:50
class EquatableConfig {
/// Global [stringify] setting for all [Equatable] instances.
/// If [stringify] is overridden for a particular [Equatable] instance,
/// then the local [stringify] value takes precendence

Choose a reason for hiding this comment

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

@felangel small typo precedence

@YeungKC
Copy link

YeungKC commented May 31, 2020

good!!!!!!!!!!!!!!thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal] Global Stringify Make stringify = true by default
5 participants