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 $this->pull() component method #8266

Merged
merged 1 commit into from
Apr 5, 2024
Merged

Add $this->pull() component method #8266

merged 1 commit into from
Apr 5, 2024

Conversation

calebporzio
Copy link
Collaborator

Often, when using $this->reset(), I have to "use" a value first, then reset it. It would be nice to have a method like $this->pull() that did both operations in one swoop like so:

public $todos = [];

public $todo = '';

public function addTodo()
{
    $this->todos[] = $this->pull('todo');
}

@calebporzio calebporzio marked this pull request as ready for review April 5, 2024 19:41
@calebporzio calebporzio merged commit 740d0a8 into main Apr 5, 2024
15 checks passed
@joshhanley joshhanley deleted the add-pull-method branch April 5, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant