Skip to content

How to know if a change will be made or was made? #24

@codingedgar

Description

@codingedgar

I see two options:

  1. Maybe the update functions can tell if a change was performed.
  2. Maybe the guards can be exported functions that state if a change was performed or not.

1 Cons

  • The update functions have to return a tuple?

2 Cons

  • The guards shouldn't be too underperforming to avoid the overhead of running them twice.
  • The guards will be run twice.

1 Pros

  • The guards can still be functions.
  • The guards will only be run once.

2 Pros

  • The user can check if the function will or not perform an action without running the action itself, opening other kinds of branching.

Update:
I think I like option 1, with option 2.

  • Extract and export guards as functions
  • Make updates functions return if they performed a change or not

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions