Skip to content

Use explicit default for configuration#658

Open
shioyama wants to merge 1 commit intomasterfrom
shioyama/use_explicit_configuration_as_default
Open

Use explicit default for configuration#658
shioyama wants to merge 1 commit intomasterfrom
shioyama/use_explicit_configuration_as_default

Conversation

@shioyama
Copy link
Copy Markdown
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
Copy Markdown
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