https://github.com/danielxmoore/observable
https://github.com/danielxmoore/observable
coffeescript observable punkrock reactive
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/danielxmoore/observable
- Owner: DanielXMoore
- Created: 2014-02-23T23:17:52.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T02:41:05.000Z (almost 2 years ago)
- Last Synced: 2025-04-07T23:48:30.466Z (over 1 year ago)
- Topics: coffeescript, observable, punkrock, reactive
- Language: Shell
- Homepage: http://observable.us
- Size: 369 KB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/DanielXMoore/Observable/actions/workflows/build.yml)
[](https://coveralls.io/github/DanielXMoore/Observable?branch=master)
Observable
==========
Installation
------------
Node
npm @danielx/observable
Usage
-----
Observable = require "@danielx/observable"
Get notified when the value changes.
observable = Observable 5
observable() # 5
observable.observe (newValue) ->
console.log newValue
observable 10 # logs 10 to console
Arrays
------
Proxy array methods.
observable = Observable [1, 2, 3]
observable.forEach (value) ->
# 1, 2, 3
Functions
---------
Automagically compute dependencies for observable functions.
firstName = Observable "Duder"
lastName = Observable "Man"
o = Observable ->
"#{firstName()} #{lastName()}"
o.observe (newValue) ->
assert.equal newValue, "Duder Bro"
lastName "Bro"
Changelog
---------
### 0.6.0
- ES6 Exports
### 0.5.1
- Exporting TypeScript types