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.
Clockvine 2 is under development and should be considered unstable.
Clockvine is a Vue 3 library for providing reactive objects in front of back end APIs.
defineApiStore returns a Pinia Store with the following actions:
index(paramsRef)
- Returns a Proxy object whose attributes are readonly reactive references to the respective keys in the API response. In practice, you can think of this as { data: ref<Array>, meta: ref<Object> }
and you'd use it like this:const { data, meta } = clockvineStore.index()
// You can also use destructuring to use a better variable name than data:
const { data: users, meta } = clockvineStore.index()
indexAsRef(paramsRef)
- Returns a readonly reactive ref object for the index itself. You probably don't want to use this one, but in practice, you can think of this as ref<{ data: Array, meta: Object}>
, where you need to get the value of the index before accessing attributes.
invalidateIndex(paramsRef)
- Invalidates the cached version of an index. If anything is using the index, a new API request will happen automatically.
invalidateAllIndexes()
- invalidates all indexes within the clockvine store.
show(idRef)
- Returns a readonly reactive ref object for the element with primary key idRef
. if idRef
is reactive, then idRef
will be a reactive dependency.
store(element)
- Stores element
in the back end and returns a readonly reactive ref object of the new element. Invalidates all cached indexes.
update(element)
- Updates element
in the back end and returns a readonly reactive ref object of the updated element. Invalidates all cached indexes.
destroy(element)
- Deletes element
in the back end and returns the element. Invalidates all cached indexes.
invalidate(elementOrIdRef)
- Invalidates the cached version of the element specified. If anything is using this element still, a new API request will happen automatically.
Clockvine is lazy - simply getting a reactive reference to an index or element will not cause any API queries to happen. API queries will happen when the values are used.
JsonApi implements the back end 'interface' required by Clockvine and encapsulates all communication with the external API. JsonApi is a minimal example based on fetch()
.
JsonSingletonApi is similar to JsonApi but is meant for API endpoints that only manage a single element (no index or primary keys.) It doesn't work yet.
FAQs
Clockvine =========
The npm package clockvine receives a total of 5 weekly downloads. As such, clockvine popularity was classified as not popular.
We found that clockvine 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.