Installations
npm install reatom-solid
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
18.14.2
NPM Version
9.5.0
Score
62.2
Supply Chain
93.4
Quality
75.9
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
skrylnikov
Download Statistics
Total Downloads
1,900
Last Day
1
Last Week
1
Last Month
17
Last Year
221
GitHub Statistics
14 Stars
40 Commits
1 Forks
2 Watching
3 Branches
1 Contributors
Package Meta Information
Latest Version
2.0.1
Package Id
reatom-solid@2.0.1
Unpacked Size
16.91 kB
Size
4.59 kB
File Count
12
NPM Version
9.5.0
Node Version
18.14.2
Publised On
20 Oct 2023
Total Downloads
Cumulative downloads
Total Downloads
1,900
Last day
0%
1
Compared to previous day
Last week
-50%
1
Compared to previous week
Last month
142.9%
17
Compared to previous month
Last year
-52.7%
221
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
2
Dev Dependencies
4
reatom-solid
Solid bindings package for Reatom store.
🚫 Deprecated❗️❗️❗️
Please use official adapter
Install
npm i reatom-solid
or
1yarn add reatom-solid
reatom-solid
depends on and works with@reatom/core
andsolid-js
.
Hooks Api
useAtom
Connects the atom to the store represented in context and returns the state of the atom from the store (or default atom state).
Basic (useAtom)
1const [atomValue] = useAtom(atom)
Depended value by selector
1const atomValue = useAtom(atom, atomState => atomState[props.id]) 2const atomValue = createMemo(() => { 3 const atom = createAtom({ dataAtom }, ({ get }) => get("dataAtom")[props.id]); 4 const [value] = useAtom(atom); 5 return value; 6});
useAction
Binds action with dispatch to the store provided in the context.
Basic (useAction)
1const handleUpdateData = useAction(dataAtom.update)
Prepare payload for dispatch
1const handleUpdateData = useAction((value) => dataAtom.update({ id: props.id, value }))
Conditional dispatch
If action creator don't return an action dispatch not calling.
1const handleUpdateData = useAction((payload) => { 2 if (condition) return dataAtom.update(payload) 3})
Usage
Step 0 - OPTIONAL. Create store
1// App 2 3import { createStore } from '@reatom/core' 4import { reatomContext } from 'reatom-solid' 5import { Form } from './components/Form' 6 7import './App.css' 8 9export const App = () => { 10 // create statefull context for atoms execution 11 const store = createStore() 12 13 return ( 14 <div className="App"> 15 <reatomContext.Provider value={store}> 16 <Form /> 17 </reatomContext.Provider> 18 </div> 19 ) 20}
Step 1. Bind your atoms.
1// components/Form 2 3import { createPrimitiveAtom } from '@reatom/core/primitives' 4import { useAtom } from 'reatom-solid' 5 6const nameAtom = createPrimitiveAtom('', { 7 onChange: (e) => e.currentTarget.value, 8}) 9 10export const Form = () => { 11 const [name, { onChange }] = useAtom(nameAtom) 12 13 return ( 14 <form> 15 <label htmlFor="name">Enter your name</label> 16 <input id="name" value={name} onChange={onChange} /> 17 </form> 18 ) 19}
Demo
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.md:0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Info: no jobLevel write permissions found
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
Reason
SAST tool detected but not run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Warn: 0 commits out of 18 are checked with a SAST tool
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/skrylnikov/reatom-solid/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/skrylnikov/reatom-solid/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/skrylnikov/reatom-solid/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/skrylnikov/reatom-solid/codeql-analysis.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
4.5
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More