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: access the state and getters through this #190

Merged
merged 7 commits into from
Sep 22, 2020
Merged

Conversation

posva
Copy link
Member

@posva posva commented Jun 23, 2020

  • Removes the need of writing .state in this.state.name = 'eduardo': this.name = 'Eduardo'
  • Removes the need of using .value for getters

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • All tests are passing
  • New/updated tests are included

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #190   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          112       117    +5     
  Branches        19        19           
=========================================
+ Hits           112       117    +5     
Impacted Files Coverage Δ
src/index.ts 100.00% <ø> (ø)
src/types.ts 100.00% <ø> (ø)
src/ssrPlugin.ts 100.00% <100.00%> (ø)
src/store.ts 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 cae8fca...2721814. Read the comment docs.

BREAKING CHANGE: getters no longer have `state` and `getters` as
arguments. Instead can access the state and getters directly through
this e.g. `this.valueOfTheState`, `this.doubleCount`.
@posva posva changed the title Access to the state through this and access to this inside getters feat: access the state and getters through this Sep 22, 2020
@posva posva merged commit 7bb7733 into master Sep 22, 2020
@posva posva deleted the feat/flat-access branch September 22, 2020 08:08
posva added a commit that referenced this pull request Sep 22, 2020
BREAKING CHANGE: there is no longer a `state` property on the store,
you need to directly access it. `getters` no longer receive parameters,
directly call `this.myState` to read state and other getters.
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.

None yet

2 participants