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

docs: signals in Oryx #1989

Merged
merged 32 commits into from
Aug 15, 2023
Merged

docs: signals in Oryx #1989

merged 32 commits into from
Aug 15, 2023

Conversation

dunqan
Copy link
Contributor

@dunqan dunqan commented Jul 10, 2023

Documentation of signals in Oryx.

closes HRZ-2767

@VadymSachenko VadymSachenko added TW review needed PR needs Technical writer's review small changes PR contains small changes, like typo fixes labels Jul 11, 2023
@VadymSachenko VadymSachenko added in TW review PR is in review by a technical writer and removed TW review needed PR needs Technical writer's review labels Jul 11, 2023
}
```

In the above example, the `logProductCode` effect will automatically start when `MyComponent` is connected to the DOM, logging the product code everytime $product signal will update. Once the component is disconnected from the DOM, the effect will automatically stop. This directive simplifies effect management by automatically linking them to component lifecycles, making your component code cleaner and easier to manage.
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, avoid future tenses as much as possible. Also, this sentence looks unclear, so consider rephrasing or splitting it into two smaller ones: "In the preceding example, the logProductCode effect automatically starts when MyComponent is connected to the DOM, logging the product code every time, and the $product signal updates."

Suggested change
In the above example, the `logProductCode` effect will automatically start when `MyComponent` is connected to the DOM, logging the product code everytime $product signal will update. Once the component is disconnected from the DOM, the effect will automatically stop. This directive simplifies effect management by automatically linking them to component lifecycles, making your component code cleaner and easier to manage.
In the above example, the `logProductCode` effect starts automatically when `MyComponent` is connected to the DOM, logging the product code every time the $product signal updates. Once the component is disconnected from the DOM, the effect automatically stops. This directive simplifies effect management by automatically linking them to component lifecycles, making your component code cleaner and easier to manage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

improved

@VadymSachenko VadymSachenko added in progress PR is not ready for review and removed in TW review PR is in review by a technical writer labels Jul 11, 2023
dunqan and others added 7 commits July 11, 2023 17:04
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
dunqan and others added 8 commits July 11, 2023 17:06
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>
…ignals.md

Co-authored-by: Vadym Sachenko <vadym.sachenko@spryker.com>

You can initialize signals with options to adjust their behavior:

- `equal`: allows for a custom equality function between two consecutive signal values. By default, strict comparison is used. Implementing your own function gives control over when a signal updates, avoiding unnecessary updates and performance costs when new and old values are practically identical.
Copy link
Collaborator

Choose a reason for hiding this comment

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

gives control over when a signal updates Please clarify the meaning of this or update this sentence to improve clarity

Copy link
Contributor

Choose a reason for hiding this comment

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

I've updated the docs with a slightly different intro to the signal topic and a small tweak in the text above.

@andriitserkovnyi andriitserkovnyi requested a review from a team as a code owner August 14, 2023 08:10
@andriitserkovnyi andriitserkovnyi merged commit 4dab424 into master Aug 15, 2023
@andriitserkovnyi andriitserkovnyi deleted the docs/oryx-signals branch August 15, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress PR is not ready for review small changes PR contains small changes, like typo fixes
Development

Successfully merging this pull request may close these issues.

5 participants