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 the ability to save events in the write model Feature class #15

Closed
kpicaza opened this issue Oct 2, 2021 · 0 comments · Fixed by #21
Closed

Add the ability to save events in the write model Feature class #15

kpicaza opened this issue Oct 2, 2021 · 0 comments · Fixed by #21
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest HacktoberFest related issues

Comments

@kpicaza
Copy link
Member

kpicaza commented Oct 2, 2021

Epic: pheature-flags/pheature-flags#297

We have to store the actions that occurred in the Pheature\Core\Toggle\Write\Feature as events.

Example implementation, of what we are thinking on:

<?php
...
class Feature {
   private array $events = [];

   public function popEvents()
   {
       $events = $this-events;
       foreach($events as $event) {
            $this->apply($event); // not mandatory because we are not doing event sourcing here
       }
       $this->events = [];
       return $events;
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest HacktoberFest related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant