Added license & updated build to cache node_modules
This commit is contained in:
parent
14fbd7d089
commit
cd80208734
11
.github/workflows/build.yaml
vendored
11
.github/workflows/build.yaml
vendored
@ -17,6 +17,11 @@ jobs:
|
|||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
uses: ztimson/actions/clone@develop
|
uses: ztimson/actions/clone@develop
|
||||||
|
|
||||||
|
- name: Restore node_modules
|
||||||
|
uses: ztimson/actions/cache/restore@develop
|
||||||
|
with:
|
||||||
|
key: node_modules
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm i
|
run: npm i
|
||||||
|
|
||||||
@ -26,6 +31,12 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: npm run test:coverage
|
run: npm run test:coverage
|
||||||
|
|
||||||
|
- name: Cache node_modules
|
||||||
|
uses: ztimson/actions/cache@develop
|
||||||
|
with:
|
||||||
|
key: node_modules
|
||||||
|
pattern: node_modules
|
||||||
|
|
||||||
- name: Cache Artifacts
|
- name: Cache Artifacts
|
||||||
uses: ztimson/actions/cache@develop
|
uses: ztimson/actions/cache@develop
|
||||||
with:
|
with:
|
||||||
|
7
LICENSE
Normal file
7
LICENSE
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
Copyright (c) 2023 Zakary Timson
|
||||||
|
|
||||||
|
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.
|
21
README.md
21
README.md
@ -42,10 +42,6 @@
|
|||||||
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||||
|
|
||||||
### Demo
|
|
||||||
|
|
||||||
Website: https://git.zakscode.com
|
|
||||||
|
|
||||||
### Built With
|
### Built With
|
||||||
[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white)](https://typescriptlang.org/)
|
[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white)](https://typescriptlang.org/)
|
||||||
|
|
||||||
@ -75,18 +71,23 @@ Website: https://git.zakscode.com
|
|||||||
```
|
```
|
||||||
3. Use persist:
|
3. Use persist:
|
||||||
```ts
|
```ts
|
||||||
import {Persist, persist} from 'ztimson/persist';
|
import {Persist} from 'ztimson/persist';
|
||||||
|
|
||||||
|
// Proxy Object (Always access/modify using `.value`):
|
||||||
let theme = new Persist<string>('theme', {default: 'os'});
|
let theme = new Persist<string>('theme', {default: 'os'});
|
||||||
theme.value = 'light'; // Any changes will be synced to localStorage['theme'];
|
|
||||||
// You have to access/modify your data through the `value` property while using the Persist object
|
|
||||||
|
|
||||||
// Or via decorator
|
console.log(theme.value) // Output: os
|
||||||
|
theme.value = 'light'; // Changes will be synced to localStorage['theme'];
|
||||||
|
```
|
||||||
|
```ts
|
||||||
|
import {persist} from 'ztimson/persist';
|
||||||
|
|
||||||
|
// Using decorators
|
||||||
class Theme {
|
class Theme {
|
||||||
// We are overriding the default key to use the same localStorage as above
|
|
||||||
@persist({key: 'theme', default: 'os'}) current!: string;
|
@persist({key: 'theme', default: 'os'}) current!: string;
|
||||||
}
|
}
|
||||||
theme = new Theme();
|
const theme = new Theme();
|
||||||
|
|
||||||
console.log(theme.current); // Output: light
|
console.log(theme.current); // Output: light
|
||||||
theme.current = 'dark'; // You can ommit `.value` when using the decorator
|
theme.current = 'dark'; // You can ommit `.value` when using the decorator
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user