![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
**[Document](http://falsandtru.github.io/lazychain/)** | **[js](https://github.com/falsandtru/lazychain/releases)** | **[d.ts](src/ts/.d/lazychain.d.ts)**
Asynchronous method chain implemented in JavaScript. FRP(Functional reactive programming) supporting jQuery plugin.
Data-Oriented Design by Pipeline
mainstream
[input]
| substream(async)
| ----> |
| : procstream
| | ----> |
| | |
| | <---- |
| |
| | ajax(async)
| | ----> |
| | :
| | <---- |
| |
| | worker(async)
| | ----> |
| | :
| | <---- |
| |
| | process
| | ----> |
| | |
| | <---- |
| |
| <---- |
|
[output]
var streams = build({
main: LazyChain(),
sub: LazyChain(),
proc: LazyChain()
});
streams.main.notify('');
function build(streams) {
streams.proc
.map(encodeURI);
streams.sub
.lazy()
.stream(streams.proc)
.lazy(req)
.filter(isXHR)
.map(conv);
streams.main
.stream(streams.sub)
.stream(alert);
return streams;
}
function req(v) {
return $.ajax(v);
}
function isXHR(v) {
return v instanceof Object;
}
function conv(xhr) {
return xhr.responseText;
}
// Maybe
var Just = Number,
Nothing = Error;
LazyChain<number>([-1, 0, 1, NaN])
.monadic([
Number, n => n > 0,
n => Just(n)
], [
Number,
_ => Nothing()
], [
void 0,
_ => Nothing()
])
.monadic([
Just,
n => Just(n * 100)
])
.monadic([
Just,
n => console.log(Just, n) // 1
], [
Nothing,
e => console.log(Nothing, e)
]);
// Either
type Either = [number, number|typeof Number];
type EitherValue = [number, number];
var LEFT: Either =
[1, Number],
Left =
(data: number) => <EitherValue>[LEFT[0], data],
RIGHT: Either =
[0, Number],
Right =
(data: number) => <EitherValue>[RIGHT[0], data],
Either = {
return: Right,
bind: (m: EitherValue, f: typeof Right|typeof Left) => <EitherValue>f.apply(undefined, [m[1]]),
fail: _ => Left(NaN)
};
var monad =
LazyChain<number>()
.monad<Either>(Either, false)
.pattern([
RIGHT,
data => Right(data + 1)
], [
LEFT,
data => Left(data)
]);
var stream =
LazyChain<number>();
stream
.monad<Either>(Either)
.stream(monad)
.pattern([
RIGHT,
function (data) {
console.log(data); // 1
return Right(data);
}
]);
stream.notify(0);
// Asynchronous method chain
LazyChain([1, 2])
.lazy(function (v, i, a, e, d) { setTimeout(function () { d.resolve(v * 2) }, 50) }, true)
.map(function (v) { return v * 3 })
.lazy(function (v, i, a, e, d) { setTimeout(function () { d.resolve(v * 10) }, 50) }, true)
.reduce(function (r, v, i, a) { return r + v }, 0)
.forEach(function (v) {
console.log(v); // 180 = (1 * 2 * 3 * 10) + (2 * 2 * 3 * 10)
});
LazyChain($.ajax(''))
.filter(function (v) { return 'object' === typeof v })
.forEach(function (xhr) {
console.log(xhr); // XHR object
});
LazyChain(true);
['./']
.lazy(function (v) { return $.ajax(v) })
.filter(function (v) { return 'object' === typeof v })
.forEach(function (xhr) {
console.log(xhr); // XHR object
});
LazyChain(false);
// Stream generate and control
var a = LazyChain(),
b = LazyChain();
LazyChain(a)
.stream('number', b)
.stream(function (v, i, a, e) {
console.log(v); // 0
});
a.notify(0, '');
b
.stream(function (v, i, a, e) {
console.log(typeof v); // string
});
LazyChain([1, 2, 3], _)
.stream(function (v) {
console.log(v); // 1, 2, 3
})
.difference([1, 3])
.stream(function (v) {
console.log(v); // 2
});
Sorry, japanese documents only. I welcome translation.
MIT License
FAQs
**[Document](http://falsandtru.github.io/lazychain/)** | **[js](https://github.com/falsandtru/lazychain/releases)** | **[d.ts](src/ts/.d/lazychain.d.ts)**
The npm package lazychain receives a total of 12 weekly downloads. As such, lazychain popularity was classified as not popular.
We found that lazychain demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.