@dashkite/belmont
v0.3.32
Published
Chicago System Resource Manager
Readme
Belmont
Chicago System Resource Manager
Purpose
Belmont manages reactive resource providers. It maps abstract resource locators to concrete URLs and delegates operations to the appropriate protocol-specific provider. This allows application logic to interact with resources (like HTTP APIs or local storage) in a uniform, reactive way.
Installation
Use your favorite package manager to install @dashkite/belmont.
Usage
import Resource from "@dashkite/belmont"
import Broadway from "@dashkite/broadway"
import Providers from "@dashkite/belmont/providers"
# Register a provider for the https protocol
Providers.add "https", Broadway
# Resolve a locator to a reactive resource
resource = await Resource.resolve
origin: "https://api.example.com"
name: "greeting"
bindings: { name: "world" }
# Subscribe to changes
resource.subscribe ({ name, value }) ->
console.log "Received #{name}:", value
# Trigger an operation
resource.get()Other Resources
Status
Not suitable for production use. Please report bugs and feature requests via the issue tracker.
