Skip to content
/ CoWBox Public

An efficient swift property wrapper for optimized state management with Copy-on-Write semantics

License

Notifications You must be signed in to change notification settings

Ryu0118/CoWBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoWBox

CoWBox is a high-efficiency property wrapper library for the Swift programming language. Leveraging the Copy-on-Write (CoW) semantics, this library optimizes state management and enhances performance. CoWBox efficiently wraps properties of classes, structures, or any type, delaying memory copies until the uniqueness of a reference is lost, thereby minimizing resource utilization.

Usage

To use CoWBox, simply wrap your property with @CoWBox. For example:

struct MyStruct {
    @CoWBox var myProperty: SomeType
}

ObservedCoWBox

@Observable
final class MyClass {
    @ObservationIgnored
    @ObservedCoWBox var myProperty: SomeType
}

This endows myProperty with Copy-on-Write semantics.

About

An efficient swift property wrapper for optimized state management with Copy-on-Write semantics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages