Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
observable set (using mobx) that produces rows of rfc6902 patches (using fast-json-patch) as readable stream.
import {Kek} from "kek"
import assert = require("assert")
type IModel = {
id: string
n: number
}
const models: IModel[] = [
{ id: "foo", n: 10 },
{ id: "bar", n: 5 }
]
const kek = new Kek<IModel>(models)
function nSum(models: IModel[]): number {
return kek.children.reduce<number>((acc, x) => {
acc += x.n
return acc
}, 0)
}
const reads = kek.observe((value, r) => {
assert(kek.children === value)
if (nSum(kek.children) === 22) {
r.dispose()
}
})
reads.on("data", changes => {
console.log(changes)
})
const baz = { id: "baz", n: 1 }
kek.add(baz)
kek.batch(() => {
baz.n = 5
kek.add({ id: "qux", n: 0 })
kek.add({ id: "quux", n: 0 })
})
kek.children.forEach(model => {
if (model.id !== "baz") {
model.n += 1
}
})
outputs:
[ { op: 'add', path: '/2', value: { id: 'baz', n: 1 } } ]
[ { op: 'replace', path: '/2/n', value: 5 },
{ op: 'add', path: '/3', value: { id: 'qux', n: 0 } },
{ op: 'add', path: '/4', value: { id: 'quux', n: 0 } } ]
[ { op: 'replace', path: '/0/n', value: 11 } ]
[ { op: 'replace', path: '/1/n', value: 6 } ]
import {Kek} from "kek"
FAQs
observable set that produces rows of rfc6902 patches as readable stream
The npm package kek receives a total of 11 weekly downloads. As such, kek popularity was classified as not popular.
We found that kek demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.