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: useStateHistory #709

Merged
merged 12 commits into from
Nov 28, 2019
Merged

feat: useStateHistory #709

merged 12 commits into from
Nov 28, 2019

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented Oct 25, 2019

Description

Introducing hook that stores defined amount of previous state values and provides handles to travel through them

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as before)

Checklist

  • Read the Contributing Guide
  • Perform a code self-review
  • Comment the code, particularly in hard-to-understand areas
  • Add documentation
  • Add hook's story at Storybook
  • Cover changes with tests
  • Ensure the test suite passes (yarn test)
  • Provide 100% tests coverage
  • Make sure code lints (yarn lint). Fix it with yarn lint:fix in case of failure.
  • Make sure types are fine (yarn lint:types).

@xobotyi xobotyi added the enhancement New feature or request label Oct 25, 2019
@streamich
Copy link
Owner

What do you think about calling it useStateWithHistory?

@xobotyi
Copy link
Contributor Author

xobotyi commented Oct 26, 2019

Current name is draft.
About your proposal - it would better convey meaning, but for my ears it somewhy sounds not very well.

@xobotyi
Copy link
Contributor Author

xobotyi commented Oct 26, 2019

I've been thinking about useHistoryfulState but not sure about it, sounds not quite right too.

…ber) method;

impl(useStateHistory): improved story demo;
impl(useStateHistory): docs;
@xobotyi xobotyi changed the title feat: useStateHistory [DRAFT] feat: useStateHistory Nov 1, 2019
@xobotyi xobotyi force-pushed the master branch 21 times, most recently from bd81db5 to 8558b58 Compare November 3, 2019 04:15
@xobotyi xobotyi force-pushed the master branch 4 times, most recently from 4baf4c2 to 7e57723 Compare November 6, 2019 20:49
@xobotyi xobotyi self-assigned this Nov 22, 2019
…ber) method;

impl(useStateHistory): improved story demo;
impl(useStateHistory): docs;
impl(useStateHistory): improved docs;
… inability to make intuitive behavior;

refactor(useStateWithHistory): changed call signature;
refactor(useStateWithHistory): reworked setState method to shift elements on capacity reach;
fix(useStateWithHistory): make the history position work properly on init;
@xobotyi xobotyi marked this pull request as ready for review November 24, 2019 19:53
@xobotyi xobotyi changed the title [DRAFT] feat: useStateHistory feat: useStateHistory Nov 25, 2019
@xobotyi
Copy link
Contributor Author

xobotyi commented Nov 25, 2019

Finalized and mergable now

@streamich
Copy link
Owner

Reviewing...

@xobotyi
Copy link
Contributor Author

xobotyi commented Nov 25, 2019

@streamich there been some files got in PR from rebase, deleted them now.

Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

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

What are the conceptual differences of this useStateWithHistory hook from useStateList hook? Can we combine them together into one?

docs/useStateWithHistory.md Show resolved Hide resolved
Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@xobotyi xobotyi merged commit 0a66359 into master Nov 28, 2019
@xobotyi xobotyi deleted the useStateHistory branch November 28, 2019 13:41
streamich pushed a commit that referenced this pull request Nov 28, 2019
# [13.10.0](v13.9.0...v13.10.0) (2019-11-28)

### Features

* useStateHistory ([#709](#709)) ([0a66359](0a66359))
@streamich
Copy link
Owner

🎉 This PR is included in version 13.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants