Last active
January 25, 2024 14:49
-
-
Save sirreal/7b9f1004b88e97c7bd6f822fcf53c2fc to your computer and use it in GitHub Desktop.
Test PR 58258
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
<body> | |
<div | |
data-wp-interactive='{"namespace":"jon/the-block"}' | |
data-wp-context='{"val":0}' | |
> | |
<input | |
readonly | |
type="number" | |
class="jon-val" | |
data-wp-bind--value="context.val" | |
value="0" | |
/> | |
<button class="jon-inc" data-wp-on--click="actions.inc">+</button> | |
<button class="jon-dec" data-wp-on--click="actions.dec">–</button> | |
</div> | |
<div | |
data-wp-interactive='{"namespace":"jon/the-block"}' | |
data-wp-context='{"val":0}' | |
> | |
<input | |
readonly | |
type="number" | |
class="jon-val" | |
data-wp-bind--value="context.val" | |
value="0" | |
/> | |
<button class="jon-inc" data-wp-on--click="actions.inc">+</button> | |
<button class="jon-dec" data-wp-on--click="actions.dec">–</button> | |
</div> | |
<script src="dist/main.js"></script> | |
</body> |
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
import * as interactivity from "jons-test-wp-interactivity"; | |
console.log("running"); | |
interactivity.store("jon/the-block", { | |
actions: { | |
inc() { | |
console.log("inc"); | |
interactivity.getContext().val += 1; | |
}, | |
dec() { | |
console.log("dec"); | |
interactivity.getContext().val -= 1; | |
}, | |
}, | |
}); |
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": "test-interactivity-package", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"jons-test-wp-interactivity": "^0.0.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment