Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/StrawberryShake/Client/src/Razor/UseQuery.cs
Comment thread
behroozbc marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public abstract class UseQuery<TResult> : ComponentBase, IDisposable where TResu

[Parameter] public RenderFragment? LoadingContent { get; set; }

[Parameter] public EventCallback<IOperationResult<TResult>> OnOperationResult { get; set; }

protected void Subscribe(IObservable<IOperationResult<TResult>> observable)
{
_subscription?.Dispose();
Expand All @@ -34,6 +36,7 @@ protected void Subscribe(IObservable<IOperationResult<TResult>> observable)
_isSuccessResult = operationResult.IsSuccessResult();
_isInitializing = false;
InvokeAsync(StateHasChanged);
OnOperationResult.InvokeAsync(operationResult);
});
}

Expand Down
3 changes: 3 additions & 0 deletions src/StrawberryShake/Client/src/Razor/UseSubscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public abstract class UseSubscription<TResult> : ComponentBase, IDisposable wher

[Parameter] public RenderFragment? LoadingContent { get; set; }

[Parameter] public EventCallback<IOperationResult<TResult>> OnOperationResult { get; set; }

protected void Subscribe(IObservable<IOperationResult<TResult>> observable)
{
_subscription?.Dispose();
Expand All @@ -32,6 +34,7 @@ protected void Subscribe(IObservable<IOperationResult<TResult>> observable)
_isSuccessResult = operationResult.IsSuccessResult();
_isInitializing = false;
InvokeAsync(StateHasChanged);
OnOperationResult.InvokeAsync(operationResult);
});
}

Expand Down