Skip to content

Commit

Permalink
fix: Adapt to upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Jan 10, 2025
1 parent 2e9aea2 commit 953f71d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pub/flutter_alien_signals/lib/src/_internal/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ import 'package:alien_signals/alien_signals.dart';
extension EffectScopeUtils on EffectScope {
void Function() on() {
final prevScope = activeEffectScope;
final prevTrackId = activeScopeTrackId;
setActiveScope(this, trackId);
return () => setActiveScope(prevScope, prevTrackId);
setActiveScope(this);
return () => setActiveScope(prevScope);
}
}

extension EffectUtils on Effect {
void Function() on([EffectScope? scope]) {
final reset = scope?.on();
final prevSub = activeSub;
final prevTrackId = activeTrackId;
setActiveSub(this, nextTrackId());
setActiveSub(this);
startTrack(this);
return () {
reset?.call();
setActiveSub(prevSub, prevTrackId);
setActiveSub(prevSub);
endTrack(this);
};
}
Expand Down

0 comments on commit 953f71d

Please sign in to comment.