Skip to content

Releases: ra1028/swiftui-atom-properties

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

0.4.0

30 Jun 06:45
825e377
Compare
Choose a tag to compare

⚠️ This version contains quite a lot of breaking changes. Please check the following pull requests to see what's changed if you encounter compilation failures.

What's Changed

  • Update development tools to be latest versions by @ra1028 in #39
  • Drop support for Swift5.6 and corresponding Xcode version by @ra1028 in #40
  • Cache spm binaries on CI by @ra1028 in #41
  • Add asynchronous init in AsyncPhase by @ra1028 in #35
  • Remove unnecessary @mainactor s by @ra1028 in #38
  • Parallelize unit tests on CI by @ra1028 in #42
  • Minor Refactoring by @ra1028 in #43
  • Allow more interactions in updated side effect by @ra1028 in #44
  • Rename AtomRelay to AtomScope by @ra1028 in #45
  • Make store object public and support maintaining it manually by @ra1028 in #46
  • Add API time leeway in example app by @ra1028 in #48
  • Handle KeepAlive as a marker protocol by @ra1028 in #50
  • Fix snapshots to be taken when the atom is marked as KeepAlive by @ra1028 in #49
  • Fix bug that KeepAlive is not effective by @ra1028 in #51
  • Minor improvements to the example app. by @ra1028 in #52
  • Update docc by @ra1028 in #53
  • Scoped override by @ra1028 in #47
  • Add Override section to README by @ra1028 in #54
  • Minor refactoring by @ra1028 in #55
  • Refactor voice memo example by @ra1028 in #56
  • Add better descriptions for AtomScope's observe and override methods by @ra1028 in #57
  • Add coordinator instance to UpdatedContext by @ra1028 in #58
  • Do not dig into parents in any case if atom is overridden by @ra1028 in #59
  • Modify accessor by @ra1028 in #60
  • Internal refactoring by @ra1028 in #61
  • Add changes modifier by @ra1028 in #62
  • Internal minor refactoring by @ra1028 in #63
  • Rename AtomTextContext/waitUntilNextUpdate to waitForUpdate by @ra1028 in #64
  • Flatten scoped stores by @ra1028 in #65
  • Move restore function to ViewContext by @ra1028 in #66
  • Internal refactoring by @ra1028 in #67
  • Change default timeout interval of AtomTestContext/waitForUpdate by @ra1028 in #68
  • Remove redundant lookupOverride from reset by @ra1028 in #69
  • Use #fileID instead of #file by @ra1028 in #70
  • Reduce process redundancy by @ra1028 in #71
  • Make the default timeout interval nil by @ra1028 in #72
  • Exclusively cancel refresh by @ra1028 in #73
  • Update documentation by @ra1028 in #74

Full Changelog: 0.3.0...0.4.0

0.3.0

08 Oct 11:12
4f2816b
Compare
Choose a tag to compare

⚠️ Breaking changes

  • Atom.Context.addTermination(_:) has been obsoleted. Use the new Coordinator API implemented in #24 instead.
  • StateAtom.willSet(newValue:oldValue:context:)andStateAtom.didSet(newValue:oldValue:context)` have been obsoleted. Use the new side-effects management API implemented in #25 instead.
  • AtomObserver, AtomRoot.observe(_:), AtomRelay.observe(_:), and AtomRoot.observe(_:) have been obsoleted. Use the new Observability API implemented in #27 instead.

What's Changed

  • refactor: Atom modifier by @ra1028 in #11
  • feat: Ensure that ObservableObjectAtom notifies updates after a new @published value is set by @ra1028 in #10
  • refactor: Use ObservableObject more in examples by @ra1028 in #12
  • feat: Add a new testing interface AtomContext/waitUntilNextUpdate(timeout:) by @ra1028 in #13
  • refactor: Map app example by @ra1028 in #14
  • refactor: Internal system by @ra1028 in #15
  • refactor: DAG algorithm based state management by @ra1028 in #16
  • chore: Install development tools in the root Package.swift by @ra1028 in #21
  • chore: Remove Package.resolved by @ra1028 in #22
  • fix: Lifecycle and unsubscription problem by @ra1028 in #23
  • feat: Atom Coordinator API by @ra1028 in #24
  • feat: Add a new side-effects management API by @ra1028 in #25
  • Enable store missing assertion only for default store context by @ra1028 in #26
  • feat: New Observability API by @ra1028 in #27
  • feat: Enable to get Snapshot through AtomViewContext by @ra1028 in #28
  • refactor: Remove observe(_:) function from AtomTestContext by @ra1028 in #29
  • Do not terminate current atom state when an old snapshot is restored by @ra1028 in #30
  • Display dependency graph in DOT language by @ra1028 in #31
  • Update README by @ra1028 in #32
  • Move AtomReader to under Context directory by @ra1028 in #34
  • Add support for Xcode 14 by @ra1028 in #33

Full Changelog: 0.2.0...0.3.0