MiniProgramCacheRule constructor

  1. @JsonSerializable.new(checked: true, explicitToJson: true)
  2. @Assert.new('maxStaleSeconds == null || maxStaleSeconds > 0', 'maxStaleSeconds must be greater than zero when provided.')
const MiniProgramCacheRule({
  1. @Default.new(MiniProgramCacheMode.staleWhileError) MiniProgramCacheMode mode,
  2. @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;