rodydavis / signals.dart

Reactive programming made simple for Dart and Flutter
http://dartsignals.dev
Apache License 2.0
378 stars 44 forks source link

Where is `createEffect`? #268

Closed avioli closed 3 weeks ago

avioli commented 1 month ago

The change-log states that from version 5.0.0 the utility function createEffect was added:

https://github.com/rodydavis/signals.dart/blob/1fee8793968d4971c7a8e733ed9f29e23a812515/packages/signals_flutter/CHANGELOG.md?plain=1#L42

I don't seem to be able to find it in any version, though.

Only place I did was in the repo's changes from previous version to 5.0.0 to now: https://github.com/rodydavis/signals.dart/blob/456466c7f0f25c360245ec155f4ea16b0f941175/packages/signals_flutter/lib/src/signals/core/effect.dart

rodydavis commented 1 month ago

Reason it was removed was due to the fact anonymous functions do not have a stable hash code (as intended) and would create an exponential number of callbacks on rebuilds.

You can use listen on a signal or create an effect directly in the constructor or on init.