
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@y-block/map
Advanced tools
The `y-map` component is a tiny custom web component built with Atomico and Yjs. It allows you to bind and observe a Yjs `Y.Map` in a reactive manner, rendering its entries dynamically based on provided templates.
The y-map
component is a tiny custom web component built with Atomico and Yjs. It allows you to bind and observe a Yjs Y.Map
in a reactive manner, rendering its entries dynamically based on provided templates.
Property | Type | Description |
---|---|---|
map | Y.Map | A Yjs Map instance to be observed and rendered. |
Property | Type | Description |
---|---|---|
Unassigned | ChildNode | General content |
The following example demonstrates a basic usage of the y-map
component with static key-value pairs.
<y-map map={ymap({key1: "value1", key2: "value2"})}>
<input $:value="key1"></input>
<input $:value="key2"></input>
</y-map>
This example shows how to use the y-map component with nested y-array components to handle more complex data structures.
for example, the following code snippet demonstrates how to use the y-map
component with a nested y-array
component to handle a list of users.
Map setup:
const map = new Y.Doc().getMap("map");
map.set("users", new Y.Array([
{name: "John Doe", age: 30},
{name: "Jane Doe", age: 25}
]));
<y-map map="map">
<y-array $:array="users">
<input $:value="name"></input>
<input $:value="age"></input>
</y-array>
</y-map>
The LazyMap story demonstrates how to dynamically update the map over time. This example updates the idx property of the map every second.
<script>
const lazyMap = new Y.Doc().getMap("lazyMap");
lazyMap.set("idx", 0);
setInterval(() => {
lazyMap.set("idx", lazyMap.get("idx") + 1);
}, 1000);
</script>
<y-map map="lazyMap">
<input $:value="idx" type="number"></input>
</y-map>
FAQs
The `y-map` component is a tiny custom web component built with Atomico and Yjs. It allows you to bind and observe a Yjs `Y.Map` in a reactive manner, rendering its entries dynamically based on provided templates.
We found that @y-block/map demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.