square / flow

Name UI states, navigate between them, remember where you've been.
Apache License 2.0
2.79k stars 241 forks source link

Make it clearer which end of the Flow history stack is the top #261

Open zach-klippenstein opened 7 years ago

zach-klippenstein commented 7 years ago

It's not obvious that we treat the front of the History list as the top of the stack. You can always dig into the code to find out, but it should be easier to just read without knowing how Flow works under the hood.

I propose deprecating History#iterator() (and History.Builder, and #reverseIterator()) and replace them with something like Iterable<Object> framesTop() and Iterable<Object> History#framesFromBottom().

zach-klippenstein commented 7 years ago

This also makes using reverseIterator much more idiomatic, since you can just use a for each loop.

zach-klippenstein commented 7 years ago

Got the method names wrong, will follow up with another PR.