import 'package:rxdart/rxdart.dart';

import 'custom_auth_manager.dart';

class NumstationAuthUser {
  NumstationAuthUser({required this.loggedIn, this.uid});

  bool loggedIn;
  String? uid;
}

/// Generates a stream of the authenticated user.
BehaviorSubject<NumstationAuthUser> numstationAuthUserSubject =
    BehaviorSubject.seeded(NumstationAuthUser(loggedIn: false));
Stream<NumstationAuthUser> numstationAuthUserStream() =>
    numstationAuthUserSubject
        .asBroadcastStream()
        .map((user) => currentUser = user);
