![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.
High-precision state management using MongoDB query language.
npm i adaka
$currentDate
, $inc
, $max
, $min
, $mul
, $set
, $unset
.$[]
, $[<identifier>]
, $addToSet
, $pop
, $pull
, $pullAll
, $push
.createSelectorHook
.createStore
function to get started.import { createStore } from "adaka";
type Person = { name: string; age: number; children?: string[] };
const store = createStore<Person>({
name: "John",
age: 30,
children: ["Luke"]
});
// create a selector
const selector = store.select<{ name: string }>({ name: 1 });
// subcriber runs whenever name changes.
const unsubscribe = selector.listen(view => {
console.log("->", view);
});
// first update
store.update({ $set: { name: "Amoah" } }); //output: '-> {name:"Amoah"}'
// can also use selector.get() to obtain the value directly.
console.log(selector.get()); // {name: "Amoah"}
// second update
store.update({ $set: { name: "Donkor" } }); //output: '-> {name:"Donkor"}'
// third update on different part of the state. subscriber is not notified.
store.update({ $push: { children: "Ama" } }); // no output
// remove subscriber by calling return method.
unsubscribe();
// subscriber no longer runs
store.update({ $set: { name: "Odame" } }); // no output
// second child if person under 30
const selector = store.select<{ secondChild: string }>({
secondChild: "$children.1"
}), {age: {$lt: 30}};
selector.get() // undefined
store.update({$set: {age: 25}})
// no second child yet.
selector.get() // {}
store.update({ $push: { children: "Adrian"} })
selector.get() // { secondChild: 'Adrian' }
React >=18.0.0
is required to use this integration. The library expects it as a peer dependency.
import { createStore } from "adaka";
import { createSelectorHook } from "adaka/react"
// first create your store
const store = createStore({
status: "error",
errors: [
{ type:"api", message: "unknown error" }
],
});
// create a selector hook some where in global scope. need one per store.
const useSelector = createSelectorHook(store)
// use the hook inside your React component.
function ShowErrorTypes() {
// select the types of errors only when the status is in "error".
const { errorTypes } = useSelector({ errorTypes: "$errors.type" }, { status: "error"})
return errorTypes ? <div>Issues found: {errorTypes.join("\n")} </div> : <div/>
}
This package uses the mingo library for MongoDB query support and loads all supported query
, projection
, and expression
operators. Refer to the readme page for more information.
MIT
0.0.0 / 2023-06-03
$currentDate
, $inc
, $max
, $min
, $mul
.$[]
, $[<identifier>]
, $addToSet
, $pop
, $pull
, $pullAll
, $push
.$set
, $unset
.createSelectorHook
.FAQs
High-precision state management using MongoDB query language.
The npm package adaka receives a total of 0 weekly downloads. As such, adaka popularity was classified as not popular.
We found that adaka demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.