Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Stream<T> non-nullable #96

Closed
Closed
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
2 changes: 1 addition & 1 deletion docs/api-docs/resource.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A __Resource__ extends a [Signal](/api-docs/signal), so all the API of __Signal_
```dart
Resource({
Future<T> Function()? fetcher,
Stream<T>? Function()? stream,
Stream<T> Function()? stream,
ResourceOptions? options,
SignalBase<dynamic>? source,
});
Expand Down
6 changes: 3 additions & 3 deletions packages/solidart/lib/src/core/resource.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Resource<T> extends Signal<ResourceState<T>> {
/// {@macro resource}
factory Resource({
Future<T> Function()? fetcher,
Stream<T>? Function()? stream,
Stream<T> Function()? stream,
SignalBase<dynamic>? source,

/// {@macro SignalBase.name}
Expand Down Expand Up @@ -140,7 +140,7 @@ class Resource<T> extends Signal<ResourceState<T>> {
final Future<T> Function()? fetcher;

/// The stream used to retrieve data.
final Stream<T>? Function()? stream;
final Stream<T> Function()? stream;
StreamSubscription<T>? _streamSubscription;

// The source dispose observation
Expand Down Expand Up @@ -188,7 +188,7 @@ class Resource<T> extends Signal<ResourceState<T>> {

// The stream trasformed in a broadcast stream, if needed
Stream<T> get _stream {
final s = stream!()!;
final s = stream!();
if (!_broadcastStreams.keys.contains(s)) {
_broadcastStreams[s] = s.isBroadcast
? s
Expand Down
Loading