UNPKG

@cleanweb/utils

Version:

Simple, tiny, straight-forward utils for everyday Typescript needs.

14 lines (8 loc) 760 B
# Clean Utils Simple, tiny, straight-forward utils for everyday Typescript needs. ## Exports Current has a single export: Subscribable. This is a simple utility for setting up a simple observable pattern in Typescript. It allows you to setup an instance that multiple consumers can subscribe to with a callback, and allows you to publish updated data to all subscribers in a single line. This is a much leaner alternative to other fully featured libraries. It includes no additional features. Just a basic subscription mechanism using callbacks, nothing more. Less than a hundred lines of code. Refer to the JSDoc comments for further details on specific methods. This should show up in intellisense as you use it. The Subscribable class is fully typed.