MiniProgramCacheRule constructor
- @JsonSerializable.new(checked: true, explicitToJson: true)
- @Assert.new('maxStaleSeconds == null || maxStaleSeconds > 0', 'maxStaleSeconds must be greater than zero when provided.')
const
MiniProgramCacheRule(
{ - @Default.new(MiniProgramCacheMode.staleWhileError) MiniProgramCacheMode mode,
- @JsonKey.new(includeIfNull: false) int? maxStaleSeconds,
})
Implementation
@JsonSerializable(checked: true, explicitToJson: true)
@Assert(
'maxStaleSeconds == null || maxStaleSeconds > 0',
'maxStaleSeconds must be greater than zero when provided.',
)
const factory MiniProgramCacheRule({
@Default(MiniProgramCacheMode.staleWhileError) MiniProgramCacheMode mode,
@JsonKey(includeIfNull: false) int? maxStaleSeconds,
}) = _MiniProgramCacheRule;