private async Task OnJumpToState(JumpToStateCallback callbackInfo) { // Wait for fire+forget state notifications to ReduxDevTools to dequeue await TailTask.ConfigureAwait(false); SequenceNumberOfCurrentState = callbackInfo.payload.actionId; using (Store.BeginInternalMiddlewareChange()) { var newFeatureStates = JsonConvert.DeserializeObject <Dictionary <string, object> >(callbackInfo.state); foreach (KeyValuePair <string, object> newFeatureState in newFeatureStates) { // Get the feature with the given name if (!Store.Features.TryGetValue(newFeatureState.Key, out IFeature feature)) { continue; } object stronglyTypedFeatureState = JsonConvert.DeserializeObject( value: newFeatureState.Value.ToString(), type: feature.GetStateType()); // Now set the feature's state to the deserialized object feature.RestoreState(stronglyTypedFeatureState); } } }
private Task OnJumpToState(JumpToStateCallback callbackInfo) { SequenceNumberOfCurrentState = callbackInfo.payload.actionId; using (Store.BeginInternalMiddlewareChange()) { var newFeatureStates = JsonConvert.DeserializeObject <Dictionary <string, object> >(callbackInfo.state); foreach (KeyValuePair <string, object> newFeatureState in newFeatureStates) { // Get the feature with the given name if (!Store.Features.TryGetValue(newFeatureState.Key, out IFeature feature)) { continue; } object stronglyTypedFeatureState = JsonConvert.DeserializeObject( value: newFeatureState.Value.ToString(), type: feature.GetStateType()); // Now set the feature's state to the deserialized object feature.RestoreState(stronglyTypedFeatureState); } } return(Task.CompletedTask); }