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: improve action api #48

Merged
merged 2 commits into from
Oct 8, 2023
Merged

feat: improve action api #48

merged 2 commits into from
Oct 8, 2023

Conversation

kepta
Copy link
Contributor

@kepta kepta commented Oct 8, 2023

function incrementCounter() {
  return counterField.update(c => c+1);
}

export const mySlice = key.slice({
  counter: counterField,
  incrementCounter
});

// usage

mySlice.get(store.state).xyz // only fields
mySlice.incrementCounter() // actions are exposed

@github-actions github-actions bot added the change/feat For PR that adds a new feature label Oct 8, 2023
@kepta kepta merged commit 3c40895 into dev Oct 8, 2023
2 checks passed
@kepta kepta deleted the feat/improve-action-api branch October 8, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change/feat For PR that adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant