updateUserPresence method

  1. @override
Future<void> updateUserPresence(
  1. Presence presence
)
override

Updates MyUser.presence to the provided value.

Implementation

@override
Future<void> updateUserPresence(Presence presence) async {
  Log.debug('updateUserPresence($presence)', '$runtimeType');

  await _debounce(
    field: MyUserField.presence,
    current: () => myUser.value?.presence,
    saved: () async => (await _active)?.value.presence,
    value: presence,
    mutation:
        (s, _) async =>
            await _graphQlProvider.updateUserPresence(s ?? presence),
    update: (v, _) => myUser.update((u) => u?.presence = v ?? presence),
  );
}