This file contains hidden or 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
npm run --silent build:package-types && node ./bin/packages/build.js | |
<--- Last few GCs ---> | |
[46009:0x148008000] 48661 ms: Mark-Compact (reduce) 2046.3 (2085.4) -> 2045.7 (2085.6) MB, 1891.79 / 0.00 ms (average mu = 0.079, current mu = 0.012) allocation failure; scavenge might not succeed | |
<--- JS stacktrace ---> | |
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory |
This file contains hidden or 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
# Folders | |
/.wordpress-org | |
/.git | |
/.github | |
/blocks/node_modules | |
# Files | |
.distignore | |
.gitignore | |
/blocks/package.json |
This file contains hidden or 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
name: Deploy to WordPress.org | |
on: | |
# We only want this action to run when publishing a new release. | |
release: | |
# run only when a new release is published not when pre released. | |
types: [created] |
This file contains hidden or 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
name: Deploy to WordPress.org | |
on: | |
# We only want this action to run when publishing a new release. | |
release: | |
# run only when a new release is published not when pre released. | |
types: [created] |
This file contains hidden or 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
let instance = new azHTTPLibrary(); | |
// Make get HTTP request | |
// instance.get('https://jsonplaceholder.typicode.com/posts') | |
// .then( res => console.log(res) ) | |
// .catch( err => console.log(err) ); | |
// Make post HTTP request | |
// instance.post('https://jsonplaceholder.typicode.com/users', { name: 'azadd', username: 'ab_azad' } ) | |
// .then( res => console.log(res) ) |
This file contains hidden or 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
document.getElementById('button1').addEventListener('click', getText ); | |
document.getElementById('button2').addEventListener('click', getJSON ); | |
document.getElementById('button3').addEventListener('click', getExternal ); | |
// fetch data from local .txt file | |
// normal way | |
// function getText(e){ | |
// e.preventDefault(); | |
// fetch('test.txt') | |
// .then(function(res){ |
This file contains hidden or 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
const posts = [ | |
{title: 'Post 1', body: 'this is post 1'}, | |
{title: 'Post 2', body: 'this is post 2'}, | |
{title: 'Post 3', body: 'this is post 3'}, | |
]; | |
// Callback way | |
// function createPost(post, callback){ | |
// setTimeout(function(){ | |
// posts.push(post); |
This file contains hidden or 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
let instance = new azHTTPLibrary; | |
// GET | |
// instance.get('https://jsonplaceholder.typicode.com/posts', function(err, response){ | |
// if(err){ | |
// console.log(response); | |
// } else { | |
// console.log('Get post...'); | |
// console.log(response); | |
// } |
This file contains hidden or 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
// Book constructor | |
function Book(title, author, isbn){ | |
this.title = title; | |
this.author = author; | |
this.isbn = isbn; | |
} | |
// UI Constructor | |
function UI(){} |
This file contains hidden or 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
{ | |
"vapfem": { | |
"active": false, | |
"message": "This message comes from the json notices." | |
}, | |
"nbbfem": {} | |
} |
NewerOlder