
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
client-web-storage
Advanced tools
Powerful Web Application Data Storage and State Management Solution.
Powerful Web Application Data Storage and State Management Solution.
// todo.store.ts
import {ClientStore} from "client-web-storage";
interface ToDo {
name: string;
description: string;
complete: boolean;
}
// create a store providing the name and schema object
// with default values or javasctipt types
const todoStore = new ClientStore<ToDo>("todo", {
$name: String,
description: "No Description",
complete: false
});
Works with any web library or framework. Here is an example using React.
// app.tsx
import {useClientStore} from "client-web-storage/helpers/use-client-store";
import {Todo} from "./stores/todo.store";
import FlatList from "flatlist-react";
const App = () => {
const todos = useClientStore<Todo>("todo");
if(todos.processing) {
return <Spinner />
}
if(todos.error) {
return <p className="error">{error.message}</p>
}
const handleCreatItem = async () => {
await todos.createItem({
// only name is required (marked with $), the store will auto fill the other fields with defaults
name: "Go to Gym"
});
}
return (
<>
<button type="button" onClick={handleCreatItem}>create todo</button>
<FlatList list={todos.items} renderItem={renderTodo}/>
</>
)
}
npm install client-web-storage
import {Schema, ClientStore} from "client-web-storage";
<!-- use the latest version -->
<script src="https://unpkg.com/client-web-storage/client-web-storage.min.js"></script>
<!-- use a specific version -->
<script src="https://unpkg.com/client-web-storage@1.7.5/client-web-storage.min.js"></script>
<script>
const {Schema, ClientStore} = window.CWS;
</script>
FAQs
Powerful Web Application Data Storage and State Management Solution.
The npm package client-web-storage receives a total of 8 weekly downloads. As such, client-web-storage popularity was classified as not popular.
We found that client-web-storage 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
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.