diff --git a/docs/src/content/docs/tutorials/flutter-infinite-list.mdx b/docs/src/content/docs/tutorials/flutter-infinite-list.mdx index c9aa74a10da..41fe8168f54 100644 --- a/docs/src/content/docs/tutorials/flutter-infinite-list.mdx +++ b/docs/src/content/docs/tutorials/flutter-infinite-list.mdx @@ -170,11 +170,11 @@ Now every time a `PostEvent` is added, if it is a `PostFetched` event and there The API will return an empty array if we try to fetch beyond the maximum number of posts (100), so if we get back an empty array, our bloc will `emit` the currentState except we will set `hasReachedMax` to true. -If we cannot retrieve the posts, we throw an exception and `emit` `PostFailure()`. +If we cannot retrieve the posts, we emit `PostStatus.failure`. -If we can retrieve the posts, we return `PostSuccess()` which takes the entire list of posts. +If we can retrieve the posts, we emit `PostStatus.success` and the entire list of posts. -One optimization we can make is to `debounce` the `Events` in order to prevent spamming our API unnecessarily. We can do this by overriding the `transform` method in our `PostBloc`. +One optimization we can make is to `throttle` the `PostFetched` event in order to prevent spamming our API unnecessarily. We can do this by using the `transform` parameter when we register the `_onPostFetched` event handler. :::note Passing a `transformer` to `on` allows us to customize how events are processed.