Skip to content
This package contains the necessary structs and Publishers for each of the NEA API endpoints supported by the data.gov.sg portal.
Swift
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
.swiftpm/xcode
Sources/SGDataGovModels
Tests
.gitignore
LICENSE.md
Package.swift
README.md

README.md

SGDataGovModels

This package contains the necessary structs and Publishers for each of the NEA API endpoints supported by the data.gov.sg portal.

Usage

Include this Package as a dependency: File > Swift Packages > Add Package Dependency.

Data provided by the National Environmental Agency is available via the NEAPublishers class.

Example

var sink: AnyCancellable!

sink = NEAPublishers.pm25.receive(on: RunLoop.main).sink(receiveCompletion: { (result) in
    switch result {
    case .failure(let err):
        // handle error
    case .finished:
        // finished
    }
}, receiveValue: { (downloadedPM25Data) in
    // do something with the data
})
You can’t perform that action at this time.