Gathering detailed insights and metrics for preact-context
Gathering detailed insights and metrics for preact-context
Gathering detailed insights and metrics for preact-context
Gathering detailed insights and metrics for preact-context
npm install preact-context
Typescript
Module System
Node Version
NPM Version
TypeScript (79.79%)
JavaScript (20.21%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
150 Stars
103 Commits
7 Forks
3 Watchers
9 Branches
3 Contributors
Updated on Feb 11, 2025
Latest Version
1.1.4
Package Id
preact-context@1.1.4
Size
6.85 kB
NPM Version
6.9.0
Node Version
8.11.4
Published on
Oct 01, 2019
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
37
createContext
for preactThis is an implementation of react's new context api. You can read more about it on react's documentation page.
This package provides the createContext
factory function that can be used
in order to create a context:
1import { h } from "preact"; 2import { createContext } from "preact-context"; 3 4const Theme = createContext("dark");
The returned object contains two components: a Provider
and a Consumer
.
Consumer
It can be used in order to consume the provided object:
1<Theme.Consumer>{theme => <p>Selected theme: {theme}</p>}</Theme.Consumer>
Alternatively, it can also be used with a render property:
1<Theme.Consumer render={theme => <p>Selected theme: {theme}</p>} />
Provider
can be used in order to update the value of a context:
1<Theme.Provider value="sunny">
will change "dark" to "sunny" and notify all it's consumers of the change.
This project has been written with typescript.
The watch
script will watch for changes, compile and run the tests.
$ npm i
$ npm run watch
Licensed under the Apache License, Version 2.0
Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
project is archived
Details
Reason
Found 2/24 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
89 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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