New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

marcs-observable

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marcs-observable - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "marcs-observable",
"version": "1.0.2",
"version": "1.0.3",
"description": "a typed version of marc grabanski's observablish-values supporting frontend masters website realtime operations",

@@ -5,0 +5,0 @@ "type": "module",

@@ -55,24 +55,36 @@ # marcs-observable

#### ObservableFactory.create(initialValue: any, ...args: any[]): IObservable
```ts
ObservableFactory.create(initialValue: any, ...args: any[]): IObservable
```
Creates a new observable. If the initial value is a function, the observable becomes a computed observable. Any extra arguments will be passed to the function.
#### observable.subscribe(handler: (current: any, previous: any) => void): () => void
```ts
observable.subscribe(handler: (current: any, previous: any) => void): () => void
```
Subscribes to the observable. The handler function is called whenever the observable's value changes. The function returns an unsubscribe function.
#### observable.publish(): void
```ts
observable.value: any
```
Gets or sets the value of the observable. If the observable is a computed observable, setting the value will not affect the computed function.
```ts
observable.publish(): void
```
Publishes changes to the observable. This is usually not called directly, but is used internally when the observable's value changes.
#### observable.compute(): void
```ts
observable.compute(): void
```
Recomputes the value of a computed observable. This is usually not called directly, but is used internally when a dependency of the computed observable changes.
#### observable.value: any
```ts
Observable.delay(ms: number)
```
Gets or sets the value of the observable. If the observable is a computed observable, setting the value will not affect the computed function.
#### Observable.delay(ms: number)
Returns a promise that resolves after a delay of ms milliseconds. This is used for handling asynchronous computations in computed observables.

@@ -79,0 +91,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc