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

refactor(addon): cleanup constructors #652

Merged
merged 9 commits into from
Apr 27, 2023

Conversation

yousinix
Copy link
Member

@yousinix yousinix commented Apr 24, 2023

Lift the setting parameters to the addon constuctor itself. This helps making the addon API more readable, and much simpler.

Before

TextScaleAddon(
  setting: TextScaleSetting(
    textScales: [
      1.0,
      2.0,
    ],
    activeTextScale: 1.0,
  ),
),

After

TextScaleAddon(
  scales: [1.0, 2.0],
  initialScale: 2.0
);

@docs-page
Copy link

docs-page bot commented Apr 24, 2023

To view this pull requests documentation preview, visit the following URL:

docs.widgetbook.io/~652

Documentation is deployed and generated using docs.page.

@yousinix yousinix self-assigned this Apr 24, 2023
@yousinix yousinix force-pushed the refactor/addon/clean-constructor branch from 31b78bc to 63e66d1 Compare April 24, 2023 15:16
@yousinix yousinix requested a review from jenshor April 26, 2023 08:39
@yousinix yousinix changed the title refactor(addon): cleanup addons constructors refactor(addon): cleanup constructors Apr 26, 2023
@yousinix yousinix marked this pull request as ready for review April 26, 2023 08:43
Copy link
Member

@jenshor jenshor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, the developer has to be able to specify the default "setting" on startup.

@yousinix yousinix requested a review from jenshor April 26, 2023 09:16
@yousinix yousinix merged commit 0dd0233 into main Apr 27, 2023
@yousinix yousinix deleted the refactor/addon/clean-constructor branch April 27, 2023 11:46
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.

2 participants