Skip to content

Commit

Permalink
Add details to updating/updated hooks for arrays
Browse files Browse the repository at this point in the history
I have tried to add specific details for array hooks. 
My language is far from perfect, but at least this might help people to find the answer quicker without testing components live as I had to in this case
Related discussion: livewire/livewire#3241
  • Loading branch information
Dimonka2 authored Jul 13, 2021
1 parent 32b1ba4 commit edf0d86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lifecycle-hooks.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
dehydrateFoo | Runs before a property called `$foo` is dehydrated
updating | Runs before any update to the Livewire component's data (Using `wire:model`, not directly inside PHP)
updated | Runs after any update to the Livewire component's data (Using `wire:model`, not directly inside PHP)
updatingFoo | Runs before a property called `$foo` is updated
updatedFoo | Runs after a property called `$foo` is updated
updatingFoo | Runs before a property called `$foo` is updated. Array properties have an additional `$key` argument passed to this function to specify changing element inside array, like `updatingArray($value, $key)`
updatedFoo | Runs after a property called `$foo` is updated. Array properties have additional `$key` argument as above
updatingFooBar | Runs before updating a nested property `bar` on the `$foo` property or a multiword property such as `$fooBar` or `$foo_bar`
updatedFooBar | Runs after updating a nested property `bar` on the `$foo` property or a multiword property such as `$fooBar` or `$foo_bar`
@endcomponent
Expand Down

0 comments on commit edf0d86

Please sign in to comment.