Skip to content

Commit 84ac5bf

Browse files
committed
Replaced Alpine.effect() with framework.effect() for automatic cleanup.
1 parent 141c4af commit 84ac5bf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

demos/input-directive-alpine/index.htm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ <h1>
168168
// Every time the outer value (expression) changes, we need to persist that
169169
// value to the input scope. This will always be executed BEFORE the
170170
// "inputChanges()" hook is called below.
171-
Alpine.effect(
171+
framework.effect(
172172
() => {
173173

174174
inputEvaluator(
@@ -212,7 +212,7 @@ <h1>
212212

213213
// We want to watch for all changes to the input scope so that we can
214214
// invoke the "changes" method as needed.
215-
var effectReference = framework.effect(
215+
framework.effect(
216216
() => {
217217

218218
// This effect runs for the first time when the first "x-input"
@@ -260,8 +260,6 @@ <h1>
260260
framework.cleanup(
261261
() => {
262262

263-
// Remove reactivity.
264-
Alpine.release( effectReference );
265263
// Remove DOM expando property.
266264
delete element[ domProperty ];
267265
// Free-up other memory references ???? Probably unnecessary.

0 commit comments

Comments
 (0)