Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

concave

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concave - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

dist/basic-lens.d.ts

35

package.json
{
"name": "concave",
"version": "0.0.2",
"version": "0.0.3",
"description": "Basic lensing for React",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "dist/concave.umd.js",
"module": "dist/concave.es.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/concave.es.js",
"require": "./dist/concave.umd.js"
}
},
"author": "Gabe Scholz",
"license": "MIT",
"sideEffects": false,
"files": [
"dist"
],
"keywords": [

@@ -13,3 +24,5 @@ "react",

"optics",
"state"
"state",
"state-management",
"store"
],

@@ -22,7 +35,9 @@ "repository": {

"test": "jest",
"build": "rm -rf build && tsc",
"prepublish": "yarn test && yarn build"
"typecheck": "tsc --noEmit",
"build": "rm -rf dist && vite build",
"prepublish": "yarn test && yarn typecheck && yarn build"
},
"dependencies": {},
"devDependencies": {
"@rollup/plugin-typescript": "^8.3.0",
"@testing-library/react": "^13.0.0-alpha.5",

@@ -36,8 +51,10 @@ "@types/jest": "^27.0.3",

"ts-jest": "^27.0.7",
"typescript": "^4.5.2"
"tslib": "^2.3.1",
"typescript": "^4.5.2",
"vite": "^2.7.2"
},
"peerDependencies": {
"react": "^18",
"react-dom": "^18"
"react": "^18.0.0-rc.0",
"react-dom": "^18.0.0-rc.0"
}
}

@@ -12,10 +12,8 @@ # Lenses in React

import { create } from "react-lenses";
import Concave from "concave";
import type { State } from "./application-state";
export const { lens, LensProvider } = create<State>();
export const [lens, LensProvider] = Concave.stateless<State>();
```
The lens itself is provided via a `children` function to `LensProvider`.
```tsx

@@ -42,3 +40,3 @@ // App.tsx

import { Lens } from "react-lenses";
import { Lens } from "concave";
import type { State } from "./application-state";

@@ -60,2 +58,3 @@ import { Profile } from "./Profile";

// Profile.tsx
import { Lens } from "concave";

@@ -67,6 +66,12 @@ type Props = {

const Profile = (props: Props) => {
const [profile, updateProfile] = props.state.use();
const [name, updateProfileName] = props.state.name.use();
const [email, updateProfileEmail] = props.state.email.use();
return <input type="text" value={profile.name} onChange={(ev) => updateProfile(() => ev.target.value)} />;
return (
<>
<input type="text" value={name} onChange={(ev) => updateProfileName(() => ev.target.value)} />
<input type="email" value={email} onChange={(ev) => updateProfileEmail(() => ev.target.value)} />
</>
);
};
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc