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

Add Option processors #6394

Merged
merged 8 commits into from
Jul 14, 2020
Merged

Add Option processors #6394

merged 8 commits into from
Jul 14, 2020

Conversation

yogevbd
Copy link
Collaborator

@yogevbd yogevbd commented Jul 13, 2020

This PR adds the ability to intercept and modify options each time they applied from any command.
This feature comes in handy when there are guidelines need to be enforced when multiple developers are working together on different modules (or not).

  • Add Navigation.addOptionProcessor(optionPath: string, processor: (value: T, commandName: string) => T) - When the specific option path is being processed, the processor function gets called and the processor has the option to manipulate this specific option value by returning a new one. It also receives the specific command name which triggered that option processing.
  • Fix wallaby

optionPath examples: topBar.title.color, bottomTabs.backgroundColor.

lib/src/Navigation.ts Outdated Show resolved Hide resolved
lib/src/commands/LayoutTreeCrawler.test.ts Show resolved Hide resolved
lib/src/commands/OptionsProcessor.test.ts Outdated Show resolved Hide resolved
wallaby.js Show resolved Hide resolved
lib/src/processors/OptionProcessorsRegistry.ts Outdated Show resolved Hide resolved
lib/src/processors/OptionProcessorsRegistry.ts Outdated Show resolved Hide resolved
lib/src/processors/OptionProcessorsRegistry.ts Outdated Show resolved Hide resolved
lib/src/processors/OptionProcessorsRegistry.ts Outdated Show resolved Hide resolved
lib/src/processors/OptionProcessorsRegistry.test.ts Outdated Show resolved Hide resolved
lib/src/commands/OptionsProcessor.ts Show resolved Hide resolved
@yogevbd yogevbd requested a review from guyca July 14, 2020 11:41
lib/src/Navigation.ts Outdated Show resolved Hide resolved
@guyca guyca self-requested a review July 14, 2020 13:40
@yogevbd yogevbd merged commit 1d4d054 into master Jul 14, 2020
@guyca guyca deleted the optionProcessors branch July 14, 2020 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants