Add FAQ
29
FAQ.md
Normal file
29
FAQ.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# FAQ
|
||||
|
||||
## What happens if I store a null value?
|
||||
|
||||
Null values are stored normally. Listeners will be notified if the null differs from the previous value.
|
||||
|
||||
## Can a listener remove itself?
|
||||
|
||||
Yes, a listener can call `Ctx.INSTANCE.removeListener(...)` on itself if needed.
|
||||
|
||||
## What if a listener throws an exception?
|
||||
|
||||
Exceptions thrown in one listener will not stop other listeners from being notified, but you should handle exceptions inside the listener code.
|
||||
|
||||
## Can I use primitive types?
|
||||
|
||||
Yes, via their boxed equivalents, e.g. `Integer`, `Double`, etc.
|
||||
|
||||
## How about arrays?
|
||||
|
||||
Yes, arrays are supported and compared using `Objects.deepEquals`.
|
||||
|
||||
## How to test with mocks?
|
||||
|
||||
Use a mock of the `Listener` interface. The key-based typing makes it easy to isolate in unit tests.
|
||||
|
||||
---
|
||||
|
||||
[[Home]] | [[API Reference]] | [[Programming Guide]]
|
||||
Reference in New Issue
Block a user