Automattic / Gravatar-SDK-iOS

Gravatar SDK is a Swift library that allows you to integrate Gravatar features into your own iOS applications.
https://gravatar.com
Mozilla Public License 2.0
36 stars 1 forks source link

[DRAFT] Use an enum for the state of the models array #320

Closed andrewdmontgomery closed 2 months ago

andrewdmontgomery commented 2 months ago

Closes #

Description

Looking at the logic of fetching Avatars and storing the AvatarImageModel's of each, it looks like we either have an array of models (potentially empty) or an error, but never both.

This implements an enum to structure the state of the avatar models so that we can enforce this either/or state.

Testing Steps