Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inLimbo == !isOpen && !isClosed, which is the same as the state 'new' or 'opening', but for the same reasons of removing the CloseError, we never return the LevelUP object in the state 'new', therefore inLimbo really means isOpening
- Loading branch information
Lars-Magnus Skog
committed
Feb 16, 2013
1 parent
a40c952
commit 6adb25a
Showing
1 changed file
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6adb25a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of "limbo" was to handle the "closing" state too but I notice we're not really dealing with that now; you shouldn't be able to do anything while state == "opening" or "closing".
6adb25a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are dealing with it. If state == "opening" we just defer the operation and if it's "closing" it's not "open" so we always bail out.
6adb25a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, fair enough, I'm having trouble fitting this all in my head at the moment after campjs (and I'm currently in a meeting supposed to be listening to something totally unrelated!)
6adb25a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out #76 and I think it's much clearer what is happening. The only thing that is important is that the state is "open" and we only do something if that's the case. The only other thing that happens is that we defer if it's "opening", all other states will callback/emit an error. #76 makes all methods handle different states the same way in a consistent matter.
6adb25a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, enforcing this approach makes larger code bases far more maintainable.