MeteorBasicSharedProvider<T> constructor
MeteorBasicSharedProvider<T> ({
- String? stateKey,
- 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();
}