{"repo":"ordo-one/equatable","free":true,"listed":false,"github":"https://github.com/ordo-one/equatable","clone":"git clone https://github.com/ordo-one/equatable.git","description":"A Swift package that provides macros for generating Equatable conformances for structs for high performance SwiftUI view diffing.","language":"Swift","stars":238,"topics":["performance","swift","swift-macros","swiftui"],"license":"Apache-2.0","category":"mobile-apps","readme_excerpt":"Equatable Macros A Swift package that provides macros for generating Equatable conformances for structs. Why Use Equatable Macros? SwiftUI’s performance hinges on efficient view diffing—but the default behavior often falls short, especially with closures and complex view models. Manually writing Equatable conformances is tedious and error-prone. Equatable Macros solve this by generating optimized Equatable implementations for your SwiftUI views, ensuring accurate and performant diffing out of the box. They eliminate boilerplate, prevent regressions, and help you avoid unnecessary re-renders—boosting UI performance while keeping your codebase clean and maintainable. Ideal for teams scaling SwiftUI in large apps. Overview The @Equatable macro generates an Equatable implementation that compares all of the struct's stored instance properties, excluding properties with SwiftUI property wrappers like @State and @Environment that trigger view updates through other mechanisms. Properties that aren't Equatable and don't affect the output of the view body can be marked with @EquatableIgnored to exclude them from the generated implementation. Closures are not permitted by default but can be marked with @EquatableIgnoredUnsafeClosure to indicate that they are safe to exclude from equality checks. Installation Add this package to your project using Swift Package Manager: Then add the dependency to your target: Usage Apply the @Equatable macro to structs to automatically generate Equatable","default_branch":null,"files":null,"tree":[],"storefront":"/r/ordo-one","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ordo-one/equatable/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}