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

Simplify history feature #712

Merged
merged 4 commits into from
Nov 3, 2022
Merged

Simplify history feature #712

merged 4 commits into from
Nov 3, 2022

Conversation

jamowei
Copy link
Collaborator

@jamowei jamowei commented Nov 2, 2022

Simplifying the history feature, which includes the following changes:

  • history is synced with Store by default
// before
val store = object : RootStore<String>("") {
    val hist = history<String>().sync(this)
}
// now
val store = object : RootStore<String>("") {
    val hist = history() // synced = true
}
  • renamed reset() method to clear()
  • renamed add(entry) method to push(entry)
  • removed last() method, cause with current: List<T> every entry is receivable
  • changed default capacity to 0 (no restriction) instead of 10 entries

fixes #665

@jamowei jamowei added this to the 1.0-RC2 milestone Nov 2, 2022
@jamowei jamowei requested review from jwstegemann and a user November 2, 2022 16:15
@jamowei jamowei self-assigned this Nov 2, 2022
@jamowei jamowei changed the title Simplify history Simplify history feature Nov 2, 2022
@jwstegemann jwstegemann merged commit 5902224 into master Nov 3, 2022
@jwstegemann jwstegemann deleted the jamowei/history branch November 3, 2022 10:11
@ghost ghost added the api breaking Forces client sources to change label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api breaking Forces client sources to change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rethink History API or at least internal implementation
2 participants