refactored and condensed technical documentation and comments across the codebase to improve readability
This commit is contained in:
@@ -17,9 +17,8 @@ class SettingsCubit extends HydratedCubit<Settings> {
|
||||
Settings val({bool write = false}) {
|
||||
if (write) {
|
||||
// Defer the emit until the synchronous mutation on the returned object
|
||||
// has finished. Without this scheduleMicrotask the cubit emits a copy
|
||||
// captured *before* the assignment runs, so listeners (and HydratedBloc
|
||||
// persistence) see the old value on the first emit.
|
||||
// has finished — without this microtask the cubit emits a copy captured
|
||||
// *before* the assignment, so listeners see the old value.
|
||||
if (!_emitScheduled) {
|
||||
_emitScheduled = true;
|
||||
scheduleMicrotask(() {
|
||||
|
||||
Reference in New Issue
Block a user