Home > Blockchain >  ReactionDisposer is not recognizing change in enum ( mobx )
ReactionDisposer is not recognizing change in enum ( mobx )

Time:08-13

After the update of flutter_mobx: ^2.0.6 1 and mobx_codegen: ^2.0.7 the ReactionDisposer is not recognizing changes in enum

 late ReactionDisposer _refreshDisposer;
 Completer<dynamic> refreshCompleter = new Completer();

 @override
  void initState() {
    super.initState();
   _refreshDisposer = reaction((_) => _vendorStore.serviceState, (_) {
      if (_ != LoadingEnum.loading) {
        refreshCompleter.complete();
        refreshCompleter = Completer();
      }
     });
  }

Observer is working fine but ReactionDisposer is not working according to change

flutter :3.0.5
Dart 2.17.6

CodePudding user response:

The new flutter_mobx: ^2.0.6 1 and mobx_codegen: ^2.0.7 has no effect on the below import

import 'package:mobx/mobx.dart';

so to work the ReactionDisposer add this plugin mobx: ^2.0.7 5 in you'r dependencies else it won't recognize the change

  • Related