MeteorBasicSharedProvider<T> constructor

MeteorBasicSharedProvider<T>({
  1. String? stateKey,
  2. T? initialValue,
})

Implementation

MeteorBasicSharedProvider({String? stateKey, T? initialValue}) {
  _sharedState = initialValue;
  _stateKey = stateKey ?? runtimeType.toString();
  MeteorEventBus.addListener(
    eventName: _eventName,
    listener: (dynamic data) {
      if (data is T) {
        _updateCurrentEngineState(data);
      }
    },
  );
  _setupState();
}