pax_global_header 0000666 0000000 0000000 00000000064 14727434644 0014531 g ustar 00root root 0000000 0000000 52 comment=0855d4b3478326fda30efff7e0511540be7f57e8 theKashey-react-style-singleton-3a11c21/ 0000775 0000000 0000000 00000000000 14727434644 0020225 5 ustar 00root root 0000000 0000000 theKashey-react-style-singleton-3a11c21/.eslintrc.js 0000664 0000000 0000000 00000003501 14727434644 0022463 0 ustar 00root root 0000000 0000000 module.exports = { extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/typescript', 'plugin:react-hooks/recommended'], parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint', 'prettier', 'import'], rules: { '@typescript-eslint/ban-ts-comment': 0, '@typescript-eslint/ban-ts-ignore': 0, '@typescript-eslint/no-var-requires': 0, '@typescript-eslint/camelcase': 0, 'import/order': [ 'error', { 'newlines-between': 'always-and-inside-groups', alphabetize: { order: 'asc', }, groups: ['builtin', 'external', 'internal', ['parent', 'index', 'sibling']], }, ], 'padding-line-between-statements': [ 'error', // IMPORT { blankLine: 'always', prev: 'import', next: '*', }, { blankLine: 'any', prev: 'import', next: 'import', }, // EXPORT { blankLine: 'always', prev: '*', next: 'export', }, { blankLine: 'any', prev: 'export', next: 'export', }, { blankLine: 'always', prev: '*', next: ['const', 'let'], }, { blankLine: 'any', prev: ['const', 'let'], next: ['const', 'let'], }, // BLOCKS { blankLine: 'always', prev: ['block', 'block-like', 'class', 'function', 'multiline-expression'], next: '*', }, { blankLine: 'always', prev: '*', next: ['block', 'block-like', 'class', 'function', 'return', 'multiline-expression'], }, ], }, settings: { 'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'], }, 'import/resolver': { typescript: { alwaysTryTypes: true, }, }, }, }; theKashey-react-style-singleton-3a11c21/.gitignore 0000664 0000000 0000000 00000000050 14727434644 0022210 0 ustar 00root root 0000000 0000000 node_modules/ /dist/ .DS_Store coverage/ theKashey-react-style-singleton-3a11c21/.npmignore 0000664 0000000 0000000 00000000055 14727434644 0022224 0 ustar 00root root 0000000 0000000 node_modules/ npm-debug.log .DS_Store example theKashey-react-style-singleton-3a11c21/.npmrc 0000664 0000000 0000000 00000000043 14727434644 0021342 0 ustar 00root root 0000000 0000000 registry=https://registry.npmjs.org theKashey-react-style-singleton-3a11c21/.nvmrc 0000664 0000000 0000000 00000000002 14727434644 0021343 0 ustar 00root root 0000000 0000000 20 theKashey-react-style-singleton-3a11c21/.size-limit.js 0000664 0000000 0000000 00000000126 14727434644 0022726 0 ustar 00root root 0000000 0000000 module.exports = [ { path: 'dist/es2015/index.js', limit: '0.7 KB', }, ]; theKashey-react-style-singleton-3a11c21/.size.json 0000664 0000000 0000000 00000000152 14727434644 0022146 0 ustar 00root root 0000000 0000000 [ { "name": "dist/es2015/index.js", "passed": true, "size": 653, "sizeLimit": 700 } ] theKashey-react-style-singleton-3a11c21/.travis.yml 0000664 0000000 0000000 00000000157 14727434644 0022341 0 ustar 00root root 0000000 0000000 language: node_js node_js: - '10' cache: yarn script: - yarn - yarn test:ci notifications: email: false theKashey-react-style-singleton-3a11c21/LICENSE 0000664 0000000 0000000 00000002057 14727434644 0021236 0 ustar 00root root 0000000 0000000 MIT License Copyright (c) 2017 Anton Korzunov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. theKashey-react-style-singleton-3a11c21/README.md 0000664 0000000 0000000 00000001542 14727434644 0021506 0 ustar 00root root 0000000 0000000 react-style-singleton ==== __300b__ with all dependencies, minified and gzipped Creates a style component with internal _tracker_. - Adds styles to the browser on the __first__ instance mount. - Removes after the __last__ instance unmount. - Thus helps you deliver styles you need to the customer, and clean up later. - Is not server-side rendering compatible! # API ## Component ```js import {styleSingleton} from 'react-style-singleton' const Style = styleSingleton(); export const App = () => ( ); ``` ## Hook ```js import {styleHookSingleton} from 'react-style-singleton'; const useStyle = styleHookSingleton(); const useAnotherStyle = styleHookSingleton(); export const App = () => { useStyle('div {color:red}'); useAnotherStyle('body { background-color:red }'); return (
); } ``` # License MIT theKashey-react-style-singleton-3a11c21/__tests__/ 0000775 0000000 0000000 00000000000 14727434644 0022163 5 ustar 00root root 0000000 0000000 theKashey-react-style-singleton-3a11c21/__tests__/index.tsx 0000664 0000000 0000000 00000000226 14727434644 0024032 0 ustar 00root root 0000000 0000000 import { styleSingleton } from '../src'; describe('Specs', () => { it('Foo', () => { expect(styleSingleton).toEqual(styleSingleton); }); }); theKashey-react-style-singleton-3a11c21/example/ 0000775 0000000 0000000 00000000000 14727434644 0021660 5 ustar 00root root 0000000 0000000 theKashey-react-style-singleton-3a11c21/example/app.tsx 0000664 0000000 0000000 00000000756 14727434644 0023210 0 ustar 00root root 0000000 0000000 import * as React from 'react'; import {styleSingleton} from "../src"; const Style = styleSingleton(); const App = () => { const [on, setOn] = React.useState(true); const click = React.useCallback(() => setOn(!on), [on]); return (