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

Use explicit default for configuration #658

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shioyama
Copy link
Owner

A few years later, I find the "magical" implict receiver format used in the curent readme kind of weird:

Mobility.configure do
  backend :key_value

  ...
end

Mobility actually also supports a more explicit variant:

Mobility.configure do |config|
  config.plugin(:backend, :key_value)

  ...
end

I kind of prefer the latter. Although it's more characters to type (and a lot of "plugin") I think it's actually more readable.

What do folks think?

@shioyama shioyama force-pushed the shioyama/use_explicit_configuration_as_default branch 2 times, most recently from 94efc16 to 49ec9b0 Compare November 30, 2024 07:59
@shioyama shioyama force-pushed the shioyama/use_explicit_configuration_as_default branch from 49ec9b0 to 4911222 Compare November 30, 2024 08:01
@shioyama
Copy link
Owner Author

I also really don't like this kind of thing:

  config.plugin(:dirty, false)

What the false means here is super obscure. But I don't know how to improve this without breaking backwards compatibility 🤔

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.

1 participant