Skip to content

Commit

Permalink
fix: bad documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chimon2000 committed Apr 22, 2020
1 parent c049fd4 commit 6e5cb57
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RemoteData
# RemoteState

![Build & test](https://github.com/chimon2000/remote_state/workflows/Build%20&%20test/badge.svg)
[![codecov](https://codecov.io/gh/chimon2000/remote_state/branch/master/graph/badge.svg)](https://codecov.io/gh/chimon2000/remote_state)
Expand Down Expand Up @@ -28,7 +28,7 @@ Instead of using a complex object we use a single data type to express all possi

## Usage

A common use case for RemoteData would be mapping it into a UI transition or component state. Here is an example that uses [StateNotifier](https://pub.dev/documentation/state_notifier/latest/state_notifier/StateNotifier-class.html), found in [examples/counter_state_notifier](https://github.com/chimon2000/remote_state/blob/master/examples/counter_state_notifier)
A common use case for RemoteState would be mapping it into a UI transition or component state. Here is an example that uses [StateNotifier](https://pub.dev/documentation/state_notifier/latest/state_notifier/StateNotifier-class.html), found in [examples/counter_state_notifier](https://github.com/chimon2000/remote_state/blob/master/examples/counter_state_notifier)

### [counter/notifier/counter.dart](https://github.com/chimon2000/remote_state/blob/master/examples/counter_state_notifier/lib/counter/notifier/counter.dart)

Expand Down Expand Up @@ -142,23 +142,23 @@ class HomePage extends StatelessWidget {

### RemoteState.initial

`RemoteState.initial` is an instance of RemoteData that signifies the request hasn't been made yet.
`RemoteState.initial` is an instance of RemoteState that signifies the request hasn't been made yet.

### RemoteState.loading

`RemoteState.loading` is an instance of RemoteData that signifies the request has been made, but it hasn't returned any data yet.
`RemoteState.loading` is an instance of RemoteState that signifies the request has been made, but it hasn't returned any data yet.

### RemoteState.success

`RemoteState.success` is an instance of RemoteData that signifies the request has completed successfully and the new data (of type T) is available.
`RemoteState.success` is an instance of RemoteState that signifies the request has completed successfully and the new data (of type T) is available.

### RemoteState.empty

`RemoteState.success` is an instance of RemoteData that signifies the has completed successfully with an empty response.
`RemoteState.success` is an instance of RemoteState that signifies the has completed successfully with an empty response.

### RemoteState.error

`RemoteState.error` is an instance of RemoteData that signifies the request has failed.
`RemoteState.error` is an instance of RemoteState that signifies the request has failed.

## Pattern matching high order functions

Expand Down
14 changes: 7 additions & 7 deletions packages/remote_state/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RemoteData
# RemoteState

![Build & test](https://github.com/chimon2000/remote_state/workflows/Build%20&%20test/badge.svg)
[![codecov](https://codecov.io/gh/chimon2000/remote_state/branch/master/graph/badge.svg)](https://codecov.io/gh/chimon2000/remote_state)
Expand Down Expand Up @@ -28,7 +28,7 @@ Instead of using a complex object we use a single data type to express all possi

## Usage

A common use case for RemoteData would be mapping it into a UI transition or component state. Here is an example that uses [StateNotifier](https://pub.dev/documentation/state_notifier/latest/state_notifier/StateNotifier-class.html), found in [examples/counter_state_notifier](https://github.com/chimon2000/remote_state/blob/master/examples/counter_state_notifier)
A common use case for RemoteState would be mapping it into a UI transition or component state. Here is an example that uses [StateNotifier](https://pub.dev/documentation/state_notifier/latest/state_notifier/StateNotifier-class.html), found in [examples/counter_state_notifier](https://github.com/chimon2000/remote_state/blob/master/examples/counter_state_notifier)

### [counter/notifier/counter.dart](https://github.com/chimon2000/remote_state/blob/master/examples/counter_state_notifier/lib/counter/notifier/counter.dart)

Expand Down Expand Up @@ -142,23 +142,23 @@ class HomePage extends StatelessWidget {

### RemoteState.initial

`RemoteState.initial` is an instance of RemoteData that signifies the request hasn't been made yet.
`RemoteState.initial` is an instance of RemoteState that signifies the request hasn't been made yet.

### RemoteState.loading

`RemoteState.loading` is an instance of RemoteData that signifies the request has been made, but it hasn't returned any data yet.
`RemoteState.loading` is an instance of RemoteState that signifies the request has been made, but it hasn't returned any data yet.

### RemoteState.success

`RemoteState.success` is an instance of RemoteData that signifies the request has completed successfully and the new data (of type T) is available.
`RemoteState.success` is an instance of RemoteState that signifies the request has completed successfully and the new data (of type T) is available.

### RemoteState.empty

`RemoteState.success` is an instance of RemoteData that signifies the has completed successfully with an empty response.
`RemoteState.success` is an instance of RemoteState that signifies the has completed successfully with an empty response.

### RemoteState.error

`RemoteState.error` is an instance of RemoteData that signifies the request has failed.
`RemoteState.error` is an instance of RemoteState that signifies the request has failed.

## Pattern matching high order functions

Expand Down
8 changes: 4 additions & 4 deletions packages/remote_state/lib/remote_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class RemoteState<T> with _$RemoteState<T> {
/// Defines logic based on the current state.
///
/// [when] takes five methods as parameters that reflect each remote state.
/// [when] the returned method gets called with a [RemoteData] state, the method
/// [when] the returned method gets called with a [RemoteState] state, the method
/// matching the correct state gets called.
///
/// [initial] determines what to do if the state matches [RemoteState.initial]
Expand All @@ -59,7 +59,7 @@ abstract class RemoteState<T> with _$RemoteState<T> {
/// [maybeWhen] takes five methods as parameters that reflect each remote state
/// as well as a required [orElse] method.
///
/// [maybeWhen] the returned method gets called with a [RemoteData] state, the method
/// [maybeWhen] the returned method gets called with a [RemoteState] state, the method
/// matching the correct state gets called or [orElse] when there's no match.
///
/// [initial] determines what to do if the state matches [RemoteState.initial]
Expand All @@ -85,7 +85,7 @@ abstract class RemoteState<T> with _$RemoteState<T> {
/// Achieves the same result as [when] without destructuring.
///
/// [map] takes five methods as parameters that reflect each remote state.
/// [map] the returned method gets called with a [RemoteData] state, the method
/// [map] the returned method gets called with a [RemoteState] state, the method
/// matching the correct state gets called.
///
/// [initial] determines what to do if the state matches [RemoteState.initial]
Expand All @@ -108,7 +108,7 @@ abstract class RemoteState<T> with _$RemoteState<T> {
/// Achieves the same result as [maybeWhen] without destructuring.
///
/// [maybeMap] takes five methods as parameters that reflect each remote state.
/// [maybeMap] the returned method gets called with a [RemoteData] state, the method
/// [maybeMap] the returned method gets called with a [RemoteState] state, the method
/// matching the correct state gets called.
///
/// [initial] determines what to do if the state matches [RemoteState.initial]
Expand Down

0 comments on commit 6e5cb57

Please sign in to comment.