Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Extension coupling to precise model class
Summary: Since Extension (and Binder itself) can accept an Interface or abstract Class as the definition of the model, it's not correct to strictly prohibit exact type changes. For example, if we want to bind a Drawable as a background, we should not limit the model to bind one exact Drawable type, but rather allow any Drawable. And with the help of generics on Extension and Binder types we can be sure that `shouldUpdate` and `bind`/`unbind` methods will be called with the same model type for both current and new extension/binder. Also, arguably, check for `binder` type is not needed too, since we use it (`newExtension.binder.getClass()`) as a key to retrieve the `currentExtension`, thus we'll have the same `binder` type guaranteed. Reviewed By: pasqualeanatriello Differential Revision: D23539921 fbshipit-source-id: a9016a2dbed89c5fc5e8d5dff2d99442c97ad63d
- Loading branch information