Skip to content

Releases: ra1028/swiftui-atom-properties

0.7.4

22 Jan 09:21
eb44c7e
Compare
Choose a tag to compare

What's Changed

  • Update GitHub actions environment by @ra1028 in #163
  • Revert to use StateObject instead of State in ViewContext by @ra1028 in #162
  • Converge successive updates of an ObservableObject to a single update by @ra1028 in #164

Full Changelog: 0.7.3...0.7.4

0.7.3

20 Nov 07:29
63d4760
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.7.2...0.7.3

0.7.2

11 Oct 05:25
7b1510d
Compare
Choose a tag to compare

What's Changed

  • Fix cancellation of refreshing AsyncPhaseAtom by @ra1028 in #157

Full Changelog: 0.7.1...0.7.2

0.7.1

10 Oct 10:54
90cd87a
Compare
Choose a tag to compare

What's Changed

  • Add test with Swift 5 enabling upcoming features by @ra1028 in #156

Full Changelog: 0.7.0...0.7.1

0.7.0

09 Oct 10:20
77485a9
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.6.1...0.7.0

0.6.1

29 Aug 09:16
3abffe4
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.6.0...0.6.1

0.6.0

29 May 09:44
330123c
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 0.5.0...0.6.0

0.5.0

26 Dec 11:15
24bab62
Compare
Choose a tag to compare

New features

  • Modified atoms such as TaskAtoms modified with .phase modifier now supports to refresh.
struct FetchMoviesTaskAtom: ThrowingTaskAtom, Hashable {
    func value(context: Context) async throws -> [Movies] {
        try await fetchMovies()
    }
}

sturct MoviesView: View {
    @ViewContext
    var context

    var body: some View {
        ...
            .refreshable {
                await context.refresh(FetchMoviesTaskAtom().phase)
            }
    }
}
  • Added Refreshable attribute that allows you to implement a custom refresh ability to an atom.
struct RandomIntAtom: ValueAtom, Refreshable, Hashable {
    func value(context: Context) -> Int {
        0
    }

    func refresh(context: RefreshContext) async -> Int {
        try? await Task.sleep(nanoseconds: 3 * 1_000_000_000)
        return .random(in: 0..<100)
    }
}

sturct RandomIntView: View {
    @ViewContext
    var context

    var body: some View {
        ...
            .refreshable {
                await context.refresh(RandomIntAtom())
            }
    }
}

What's Changed

Full Changelog: 0.4.2...0.5.0

0.4.2

29 Sep 07:15
e4d1404
Compare
Choose a tag to compare

What's Changed

  • Add lookup function to AtomTestContext by @ra1028 in #81
  • Reduce testing duration on CI by @ra1028 in #82
  • Maintenance for example apps by @ra1028 in #83
  • Apply inlinable to all methods of AtomTestContext by @ra1028 in #84

Full Changelog: 0.4.1...0.4.2

0.4.1

21 Sep 10:55
d3ee4f6
Compare
Choose a tag to compare

What's Changed

  • Add support for Xcode 14.3.1 and drop support for lower by @ra1028 in #79
  • Add a new testing interface - wait(for:timeout:until) by @ra1028 in #80

Full Changelog: 0.4.0...0.4.1