Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@starbeam/reactive
Advanced tools
This package contains the implementations of the reactive primitives.
This package contains the implementations of the reactive primitives.
Reactive primitives must be used with an implementation of Runtime
, which
basically means that they must be used together with @reactive/runtime
.
The primitives themselves, and higher-level concepts built on the primitives are agnostic to the runtime, primarily to clearly mark the runtime interface and allow us to revise its implementation over time cleanly.
It is not possible to use multiple runtimes at the same time, and the runtime interface is not exposed to the user.
This package provides primitive reactive values, building on @starbeam/tags
,
which provides primitive tags (composable validation).
All primitive reactive values implement the reactive protocol:
read()
: read the current value of the reactive[TAG]
: get the tag for the reactive value. Tags are stable for the lifetime
of the reactive value, and therefore may be used to identify the value and cached.A cell represents storage for a single atomic value.
A cell has an "equivalence" property: when the cell is updated with a value that is
equivalent to the previous value, the new value is ignored. The default
equivalent property is Object.is
, but it can be overridden with the equals
option to the Cell()
constructor .
In addition to read()
, a cell also has these fundamental operations:
update(T => T)
: update the value of the cell. This method takes a callback
that receives the previous value and returns a new value. This method does not
consume the cell.freeze()
: freeze the value of the cell. The cell can no longer be updated,
so any subscribers to the cell are automatically unsubscribed.Cell
also has a few conveniences:
current
property, which is mutable. This makes it possible to write
things like cell.current++
.set
method, which just takes a new value and updates the cell.A marker is a simple primitive that has no value, but instead represents values stored elsewhere. For example, reactive collections store their values in the JavaScript collections they represent, and use markers to represent each discrete piece of storage in the collection.
A marker has these fundamental operations:
mark()
: mark the external storage as being dirty.read()
: add the external storage to the current tracking frame.freeze()
: indicate the the external storage will never change in the future.Reactive collections use markers more interestingly than just to represent external values. For example, reactive
Map
has a marker for bothhas
andget
for each entry in the map. This means that if a formula used ahas
check to check for a key's presence and it returnstrue
, updating the value of that key will not invalidate the formula.
FAQs
This package contains the implementations of the reactive primitives.
We found that @starbeam/reactive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.