Bloc: Documentation: Naming conventions and Tutorial discrepency

Created on 5 Jun 2020  路  6Comments  路  Source: felangel/bloc

I'm going through the tutorials. I came to the Timer tutorial. In there we are told to name the events Start, Pause, Resume, Reset, and Tick.

However, according to the naming conventions, I would expect the names to be TimerStarted, TimerPaused, TimerResumed, TimerReset, and TimerTicked.

The state names in the Timer tutorial seem fine to me, but they also don't conform to the naming conventions.

I haven't gone through all the tutorials yet so I don't know if other tutorials follow the naming conventions or not.

I'm sure everyone can choose for themselves whether or not to follow the naming conventions, but it seems like it would make the documentation better if it were self-consistent.

documentation example

Most helpful comment

That is great! When can we except the website to update?

EDIT: I see it now! I will go through them on Monday.

All 6 comments

I noticed the same inconsistency with State names. In the documentation it states

State should be one of the following: Initial | Success | Failure | InProgress and initial states should follow the convention: BlocSubject + Initial.
  • In the weather example there is a state named WeatherLoaded while that should be an event name.
  • Loading instead of InProgress is used.

It would be nice to update the examples using the recommended naming scheme as this confuses newcomers to the library.

Hi @fotiDim 馃憢
Thanks for opening an issue!

I鈥檓 in the process of updating the names in the tutorials to align. The naming should be correct in the actual example code though. Should have it done this weekend at the latest 馃憤

@felangel Just worked through most of BLoC examples using the recommended naming convention. Let me know if you need me to help out with updating the naming.

I believe all of the documentation and examples should adhere to the naming conventions. Please feel free to comment if you find anything I missed 馃憤

Thank you, Felix! That will make it more clear for a lot of people.

That is great! When can we except the website to update?

EDIT: I see it now! I will go through them on Monday.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shawnchan2014 picture shawnchan2014  路  3Comments

clicksocial picture clicksocial  路  3Comments

ricktotec picture ricktotec  路  3Comments

krusek picture krusek  路  3Comments

abinvp picture abinvp  路  3Comments