jinyus / dart_beacon

A reactive primitive (signals) and state management library for dart and flutter
https://pub.dev/packages/state_beacon
28 stars 2 forks source link

derivedStream? #58

Closed lukepighetti closed 7 months ago

lukepighetti commented 7 months ago

Common pattern in state management to depend on a reactive value and use it to manage/switch streams

ie:

final userProfileSignal = derivedStreamSignal<UserProfile>((){
  final uid = myUidSignal();
  return myUserProfileStream(uid);
});

and then have it automatically handle setup and teardown of the profile stream as the user id changes

Is does state_beacon have this feature, and if not, please consider this a feature request

jinyus commented 7 months ago

That's an interesting concept, I think the current derived beacon could be modified to treat streams differently..

jinyus commented 7 months ago

Added in v0.33.2