Skip to content

docs: add documentation for pre updator effects #5

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

Open
6 tasks
Pierre-MarieMarchio opened this issue May 6, 2025 · 0 comments
Open
6 tasks

docs: add documentation for pre updator effects #5

Pierre-MarieMarchio opened this issue May 6, 2025 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Pierre-MarieMarchio
Copy link
Owner

Pierre-MarieMarchio commented May 6, 2025

Description:

Update the documentation to explain how to use pre-effects:

  • Implement effects that execute before updators (pre-effects)
  • Configure different execution timings of effects in the flow
  • Maintain type safety when using pre-effects

This documentation will guide users on how to use these features and understand their scope and lifecycle.


Tasks:

  • Document the concept of pre-effects

    • Explain what pre-effects are and why they're useful
    • Provide an example of registering pre-effects (with code)
    • Explain how pre-effects integrate into the existing unidirectional flow
  • Document pre-effect use cases

    • Explain scenarios where pre-effects are preferable to standard effects
    • Provide examples of payload validation and payload generation
    • Mention limitations and specific use cases (such as testing or isolated behaviors)
  • Lifecycle and execution order

    • Describe the new execution order with pre-effects: Action → Pre-Effect → Updator → Effect
    • Explain how to configure effect timing ({ timing: 'pre' | 'post' })
    • Detail how pre-effects can modify or generate payloads before updators
  • Type safety

    • Explain type constraints for pre-effects and their returns
    • Document how to maintain type consistency between actions and pre-effects
    • Provide code examples illustrating type safety in different scenarios
  • Action cancellation

    • Document how pre-effects can be used to cancel actions
    • Provide examples of validation that prevents updator execution
  • Provide complete code snippets

    • Add working examples for pre-effects with and without payload
    • Ensure examples are clear and demonstrate real-world usage scenarios

Expected Outcome:

  • The documentation should provide a clear, structured explanation of pre-effect usage.
  • Code snippets should be easy to understand and relevant to typical use cases.
  • Developers should be able to easily integrate these patterns into their own projects.
@Pierre-MarieMarchio Pierre-MarieMarchio added the documentation Improvements or additions to documentation label May 6, 2025
@Pierre-MarieMarchio Pierre-MarieMarchio self-assigned this May 6, 2025
@Pierre-MarieMarchio Pierre-MarieMarchio changed the title **Documentation and Examples** docs: add documentation for pre updator effects May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Backlog
Development

No branches or pull requests

1 participant