-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 159b936
Showing
11 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Deploy Extension | ||
|
||
on: | ||
release: | ||
type: published | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: npm install | ||
- uses: lannonbr/vsce-action@master | ||
with: | ||
args: "publish -p $VSCE_TOKEN" | ||
env: | ||
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
out | ||
node_modules | ||
.vscode-test/ | ||
.vsix | ||
npm-debug.log | ||
vsc-extension-quickstart.md | ||
*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// A launch configuration that launches the extension inside a new window | ||
{ | ||
"version": "0.1.0", | ||
"configurations": [ | ||
{ | ||
"name": "Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceRoot}"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
.gitignore | ||
vsc-extension-quickstart.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## v1.0.0 | ||
|
||
- Initial release (Jun 13th, 2023) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2020 Frani | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<h1 align="center"> | ||
<br> | ||
<a href="#"><img src="https://github.com/frani/fracta-function-snippet/raw/master/images/logo.png" alt="fracta-function-snippet-logo" width="200"></a> | ||
<br> | ||
Fractal Function <i>Snippet</i> | ||
<br> | ||
<br> | ||
</h1> | ||
|
||
<h4 align="center">A solution to deal with errors</h4> | ||
|
||
<p align="center"> | ||
<a href="https://marketplace.visualstudio.com/items?itemName=frani.fracta-function-snippet"><img src="https://img.shields.io/visual-studio-marketplace/v/frani.fracta-function-snippet?style=flat&logo=visual-studio-code&logoColor=blue" alt="VSCode-ext"></a> | ||
<a href="https://marketplace.visualstudio.com/items?itemName=frani.fracta-function-snippet"><img alt="Visual Studio Marketplace Installs" src="https://img.shields.io/visual-studio-marketplace/i/frani.fracta-function-snippet?color=yellow"></a> | ||
<a href="https://github.com/frani/fracta-function-snippet/blob/master/LICENSE.md"><img alt="github license" src="https://img.shields.io/github/license/frani/fracta-function-snippet?color=success"></a> | ||
<a href="https://github.com/frani/fracta-function-snippet/issues"><img alt="github issues" src="https://img.shields.io/github/issues/frani/fracta-function-snippet"></a> | ||
<a href="https://marketplace.visualstudio.com/items?itemName=frani.fracta-function-snippet"><img alt="Visual Studio Marketplace Rating" src="https://img.shields.io/visual-studio-marketplace/stars/frani.fracta-function-snippet?label=rating&logo=visual-studio-code&logoColor=blue"></a> | ||
</p> | ||
|
||
# About | ||
|
||
Fractal Function Pattern was made as a solution to give a way of handler errors in a isolated way, so if something explot in a function, instead of keep throwing the error through all the system is going to receive an idempotent response so when function's caller receive the response, can determinated of what is going to receive in case something went wrong then take decition of what to do. | ||
|
||
[I wrote about this in spanish in my blog](https://frani.dev/Fractal-Funcional-Design-Pattern-57ecf46f1e644d718e763ff8905b8d4a) | ||
_I still working on it to give a better explanation haha_ | ||
|
||
--- | ||
|
||
# Install | ||
|
||
### Install with VScode: | ||
|
||
To install the extension, open the Extensions view on sidenav, search for `Fractal Function` to filter results and select `Fractal Function Snippets` authored by [Frani](https://github.com/frani). | ||
|
||
### Install with Terminal: | ||
|
||
```sh | ||
code --install-extension frani.fracta-function-snippet | ||
``` | ||
|
||
in case you have `code` command disable [see this link to enable it](https://code.visualstudio.com/docs/editor/command-line#_common-questions) | ||
|
||
# License | ||
|
||
MIT © [Frani](http://github.com/frani) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "fractal-function-snippet", | ||
"displayName": "Fractal Function Snippet", | ||
"description": "Fractal Function Snippet, a fractal pattern to implement in functional paradigma", | ||
"version": "1.0.0", | ||
"publisher": "frani", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/frani/fractal-function-snippet.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/frani/fractal-function-snippet.git/issues" | ||
}, | ||
"engines": { | ||
"vscode": "^1.18.0" | ||
}, | ||
"categories": [ | ||
"Snippets" | ||
], | ||
"icon": "images/logo.png", | ||
"keywords": [ | ||
"nodejs", | ||
"javascript", | ||
"fractals", | ||
"fractal", | ||
"fractal pattern", | ||
"fractal function" | ||
], | ||
"contributes": { | ||
"snippets": [ | ||
{ | ||
"language": "javascript", | ||
"path": "./snippets/fractal.json" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"fratal function snippet": { | ||
"prefix": "ffs", | ||
"body": [ | ||
"const ${1:name} = async ({ ${2:input} }) => {", | ||
" const payload = { success: false, data: null, message: '', errors: [] };", | ||
" try {", | ||
" $0", | ||
"", | ||
" payload.success = true;", | ||
" payload.data = data;", | ||
" return payload;", | ||
" } catch (error) {", | ||
" console.error(error);", | ||
" payload.success = false;", | ||
" payload.data = null;", | ||
" payload.errors = payload.errors.concat(error.message);", | ||
" return payload;", | ||
" }", | ||
"};" | ||
], | ||
"description": "Create a Function with Fractal Pattern" | ||
} | ||
} |