-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
59 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
namespace InertiaNetCore.Models; | ||
|
||
public readonly record struct InertiaPage() | ||
public readonly record struct InertiaPage | ||
{ | ||
public InertiaProps Props { get; init; } = default!; | ||
public string Component { get; init; } = default!; | ||
public string? Version { get; init; } = null; | ||
public string Url { get; init; } = default!; | ||
public required InertiaProps Props { get; init; } | ||
public required Dictionary<string, List<string>> DeferredProps { get; init; } | ||
public required string Component { get; init; } | ||
public required string? Version { get; init; } | ||
public required string Url { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace InertiaNetCore.Utils; | ||
|
||
/// <summary> | ||
/// Deferred props allow you to defer the loading of certain page data until after the initial page render. | ||
/// This can be useful for improving the perceived performance of your app by allowing the initial page render to happen as quickly as possible. | ||
/// </summary> | ||
public class DeferredProp<T> : InvokableProp<T>, IDeferredProp | ||
{ | ||
public string? Group { get; } | ||
|
||
public DeferredProp(Func<T?> callback, string? group) : base(callback) | ||
{ | ||
Group = group; | ||
} | ||
|
||
public DeferredProp(Func<Task<T?>> callbackAsync, string? group) : base(callbackAsync) | ||
{ | ||
Group = group; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters