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

API proposal: merge undox argument into object. #42

Open
Buggytheclown opened this issue Mar 23, 2021 · 1 comment
Open

API proposal: merge undox argument into object. #42

Buggytheclown opened this issue Mar 23, 2021 · 1 comment

Comments

@Buggytheclown
Copy link

If i want to pass limit config i need to add "initAction" and "comparator" explicitly or as undefined

undox(
  _counterReducer,
  { type: "undox/INIT" },
  (_) => false,
  {
    past: 2,
    future: Infinity
  }
)

I want to be able to pass only needed args, for example

undox(_counterReducer, {
  limit: {
    past: 2,
    future: Infinity,
  },
});
@JannicBeck
Copy link
Owner

I deliberately decided against this when I wrote this library, since I wanted to keep it simple and to the core. Where any additional features/use cases would be implemented as custom higher order reducers (at least this was the plan).
That said, I definitely see your point, its unfortunate that the limit is the third argument now, but I did not want to break backwards compatibility for "styling" reasons ...
Since the object would also break backwards compatibility it would have to be done in a major release which is not planned atm since I simply don't have enough feature requests to warrant that ...

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

No branches or pull requests

2 participants