@asphalt-react/context
Advanced tools
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| var react = require('react'); | ||
| const sendStyles=stylesheet=>{const collect=react.useContext(StyleContext);if(collect)collect(stylesheet);}; | ||
| const context=react.createContext("asphalt");const Provider=context.Provider;const Consumer=context.Consumer;const StyleContext=react.createContext();const StyleProvider=StyleContext.Provider;const StyleConsumer=StyleContext.Consumer; | ||
| exports.Consumer = Consumer; | ||
| exports.Provider = Provider; | ||
| exports.StyleConsumer = StyleConsumer; | ||
| exports.StyleContext = StyleContext; | ||
| exports.StyleProvider = StyleProvider; | ||
| exports.default = context; | ||
| exports.sendStyles = sendStyles; |
+12
-0
@@ -6,2 +6,14 @@ # Change Log | ||
| # [2.0.0-alpha.1](https://source.golabs.io/asphalt/asphalt-react/compare/v1.13.0...v2.0.0-alpha.1) (2022-03-31) | ||
| # [2.0.0-alpha.0](https://source.golabs.io/asphalt/asphalt-react/compare/v1.12.2...v2.0.0-alpha.0) (2022-02-15) | ||
| **Note:** Version bump only for package @asphalt-react/context | ||
| # [2.0.0-alpha.0](https://source.golabs.io/asphalt/asphalt-react/compare/v1.12.2...v2.0.0-alpha.0) (2022-02-15) | ||
| # [1.13.0](https://source.golabs.io/asphalt/asphalt-react/compare/v1.12.2...v1.13.0) (2022-03-30) | ||
@@ -8,0 +20,0 @@ |
+2
-16
| import { useContext, createContext } from 'react'; | ||
| /** | ||
| * Send component stylesheet to server using context. | ||
| * | ||
| * @param {string} stylesheet | ||
| */ | ||
| const sendStyles=stylesheet=>{const collect=useContext(StyleContext);if(collect)collect(stylesheet);}; | ||
| const sendStyles = stylesheet => { | ||
| const collect = useContext(StyleContext); | ||
| if (collect) collect(stylesheet); | ||
| }; | ||
| const context=createContext("asphalt");const Provider=context.Provider;const Consumer=context.Consumer;const StyleContext=createContext();const StyleProvider=StyleContext.Provider;const StyleConsumer=StyleContext.Consumer; | ||
| const context = /*#__PURE__*/createContext("asphalt"); | ||
| const Provider = context.Provider; | ||
| const Consumer = context.Consumer; | ||
| const StyleContext = /*#__PURE__*/createContext(); | ||
| const StyleProvider = StyleContext.Provider; | ||
| const StyleConsumer = StyleContext.Consumer; | ||
| export default context; | ||
| export { Consumer, Provider, StyleConsumer, StyleContext, StyleProvider, sendStyles }; |
+10
-5
| { | ||
| "name": "@asphalt-react/context", | ||
| "version": "1.13.0", | ||
| "version": "2.0.0-alpha.1", | ||
| "description": "share context among asphalt components", | ||
@@ -10,7 +10,12 @@ "keywords": [ | ||
| "author": "UX Engineering - Web <uxe@gojek.com>", | ||
| "main": "dist/cjs/index.js", | ||
| "directories": { | ||
| "test": "__tests__" | ||
| }, | ||
| "module": "dist/index.js", | ||
| "type": "module", | ||
| "main": "./dist/index.js", | ||
| "exports": { | ||
| "import": "./dist/index.js", | ||
| "require": "./dist/index.cjs", | ||
| "default": "./dist/index.js" | ||
| }, | ||
| "files": [ | ||
@@ -30,6 +35,6 @@ "dist" | ||
| "devDependencies": { | ||
| "@asphalt-react/build": "^1.13.0", | ||
| "@asphalt-react/build": "^2.0.0-alpha.1", | ||
| "@rollup/plugin-babel": "^5.3.0" | ||
| }, | ||
| "gitHead": "3f9cebe04eb753dc04819dd384e7b2c0bd6a74a9" | ||
| "gitHead": "3d38c37b17716bc5694b2d511f491a83b3073ef2" | ||
| } |
| 'use strict'; | ||
| Object.defineProperty(exports, '__esModule', { value: true }); | ||
| var react = require('react'); | ||
| /** | ||
| * Send component stylesheet to server using context. | ||
| * | ||
| * @param {string} stylesheet | ||
| */ | ||
| const sendStyles = stylesheet => { | ||
| const collect = react.useContext(StyleContext); | ||
| if (collect) collect(stylesheet); | ||
| }; | ||
| const context = /*#__PURE__*/react.createContext("asphalt"); | ||
| const Provider = context.Provider; | ||
| const Consumer = context.Consumer; | ||
| const StyleContext = /*#__PURE__*/react.createContext(); | ||
| const StyleProvider = StyleContext.Provider; | ||
| const StyleConsumer = StyleContext.Consumer; | ||
| exports.Consumer = Consumer; | ||
| exports.Provider = Provider; | ||
| exports.StyleConsumer = StyleConsumer; | ||
| exports.StyleContext = StyleContext; | ||
| exports.StyleProvider = StyleProvider; | ||
| exports.default = context; | ||
| exports.sendStyles = sendStyles; |
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
7803
2.94%Yes
NaN17
-60.47%2
100%