Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@homebound/form-state
Advanced tools
![npm](https://img.shields.io/npm/v/@homebound/form-state) [![CircleCI](https://circleci.com/gh/homebound-team/form-state.svg?style=svg)](https://circleci.com/gh/homebound-team/form-state)
form-state is a headless form state management library, built on top of mobx.
It acts as a buffer between the canonical data/entity (i.e. the server-side data, or local Redux/GraphQL/etc. cache data) and the user's WIP data/entity that is being actively mutated in form fields.
It also keeps track of low-level form UX details like:
form.changedValue
will return the entity id
+ only changed fields to faciliate doing partial update APIsauthor: { books: [...} }
will include only changed books if necessaryIn general when working with forms (e.g. not just form-state), there are three types/shapes of data involved:
<TextField value={form.firstName} onChange={(v) => form.firstName = v} />
)form-state generally refers to each of these shapes as:
input SaveAuthorInput
...we should consider changing this).And then provides an API/DSL for managing the mapping between each of these in a standard/conventional manner.
Admittedly (and hopefully, b/c it makes the code simpler), the differences between each of these types can often be small, i.e.:
{ author: { book: { id: "b:1" } }
but the mutation wants { author: { bookId: "b:1" } }
These are usually simple/mechanistic changes, but nonetheless just some boilerplate that form-state provides conventions for.
See the sample.
Add conditional readonly logic, like { type: "field", readOnlyIf: i => i.isInternal.value }
Add omitFromValue
so we can have two fields, book.author.id
/ book.author.name
, where book.author.name
is used for showing the author name, but book.author.id
is the only field that is submitted to the server on mutation (maybe pair this with Ref
based mutations)
Undo/redo would in theory be neat and easy to do on top of the existing infra
FAQs
![npm](https://img.shields.io/npm/v/@homebound/form-state) [![CircleCI](https://circleci.com/gh/homebound-team/form-state.svg?style=svg)](https://circleci.com/gh/homebound-team/form-state)
The npm package @homebound/form-state receives a total of 359 weekly downloads. As such, @homebound/form-state popularity was classified as not popular.
We found that @homebound/form-state 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.