Swiftpack.co - boweber/PersistenceMiddleware as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by boweber.
boweber/PersistenceMiddleware 0.1.0
This package provides a middleware for SwiftRex handling persistence related actions.
⭐️ 2
🕓 3 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/boweber/PersistenceMiddleware.git", from: "0.1.0")

PersistenceMiddleware

This package provides middlewares for SwiftRex handling persistence related actions.

Note: The current implementation only supports Core Data.

Modular structure

The package currently contains two targets PersistenceMiddleware and CoreDataMiddleware. The core parts (i.e. middleware, reducer, action and state), which interact with SwiftRex, are part of PersistenceMiddleware. For more information see PersistenceMiddleware. The CoreDataMiddleware connects the core parts from PersistenceMiddleware to the Core Data framework and is managing the interaction with the database. You can save, delete and request any element that conforms to the CoreDataPersistable protocol. For more, see CoreDataMiddleware.

Installation

// swift-tools-version:5.3

import PackageDescription

let package = Package(
  name: "MyApp",
  platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)],
  products: [
    .executable(name: "MyApp", targets: ["MyApp"])
  ],
  dependencies: [
    .package(url: "https://github.com/boweber/PersistenceMiddleware", from: "0.1.0")
  ],
  targets: [
    .target(
      name: "MyApp",
      dependencies: [
        .product(name: "CoreDataMiddleware", package: "PersistenceMiddleware")
      ]
    )
  ]
)

TODO

  • Add actions to cancel the current save/delete process ?!
  • Add action handling move element from index to index
  • Add multiple states for different requests ?!
    This could be archived with a dictionary (e.g. [Request.Token: RequestState]) instead of just RequestState as the request parameter type.
  • Implement section support
  • Implement cache support (reloading previously fetched elements)
  • Implement error resolving functionality
  • Improve the documentation.

GitHub

link
Stars: 2
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics