![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.
data-lackey
Advanced tools
Tired of having to build promise chains to coordinate the loading of your pages? Tired of having pages break because a user linked from a different page? Tired of overloading your server with duplicate requests for the same data? Give Data Lackey a spin....
Data Lackey orchestrates data loading for rich front-end JS applications.
With Data Lackey:
shell> yarn add data-lackey
You'll need create a "data lackey" to track your data loading. Creating a file for this:
// File: myLackey.js -- or whatever you want
import { DataLackey } from 'data-lackey'
export const myLackey = new DataLackey()
myLackey.rule('/books',
{
loader: () => fetch('/api/books')
})
myLackey.rule('/book :bookId',
{
loader: ({bookId}) => fetch(`/api/books/${bookId}`),
dependsOn: 'books'
})
And then, configure your component with a new wrapping method mapPropsToDataRsrcs
:
// File: myComponent.js
import { loadData } from 'data-lackey'
import MyComponent from './MyComponent.jsx'
const mapPropsToDataRsrcs = props => `/book ${this.props.id}`,
WrappedComponent = loadData(mapPropsToDataRsrcs)(MyComponent)
export default WrappedComponent
Now, when the component is mounted, the book
details will be requested. Since
that is dependent on the books
data as well, that will be loaded first.
Data Lackey works great with React, and removes tedious and error prone data loading code, replacing it with declarations of data depedencies. Usage within React is 100% configuration driven and is outlined here.
You can also use it directly, to isolate the load orchestration details. This is called "direct usage" and outlined here.
Data Lackey itself is well tested. As most of the configuration of Data Lackey is declarative, there's
less of a need to test this configuration. Given that, though, loader
functions can be unit tested,
as any data loading function can be tested. They are conveniently isolated from any component code.
load
: queue up a data resource to load.data resource
: a single set of data that can be loaded.undefined
: unknown data resource, not yet trackedloading
loaded
=> action unload
failed to load
unload
callback should pass in params from matcher, not just URL{ resource:
/item, itemId: 7 }
that automatically becomes /item?itemId=7
. Needs URL encoding, sorting of params.1.1.0
resource
and params
keysit
=> test
, for more natural readabilityFAQs
orchestrate your data loading
The npm package data-lackey receives a total of 23 weekly downloads. As such, data-lackey popularity was classified as not popular.
We found that data-lackey 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.