handleInitEvent method

Stream<FastAppFeaturesBlocState> handleInitEvent()

Implementation

Stream<FastAppFeaturesBlocState> handleInitEvent() async* {
  if (canInitialize) {
    _logger.debug('Initializing...');
    isInitializing = true;
    yield currentState.copyWith(isInitializing: true);

    final features = await _retrieveFeatures();

    subxList.add(
      _dataProvider.onChanges.listen((TStoreChanges changes) {
        addEvent(const FastAppFeaturesBlocEvent.retrieveFeatures());
      }),
    );

    addEvent(FastAppFeaturesBlocEvent.initialized(features));
  }
}