summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/extensions/blocks/publicize/store/actions.js')
-rw-r--r--plugins/jetpack/extensions/blocks/publicize/store/actions.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/jetpack/extensions/blocks/publicize/store/actions.js b/plugins/jetpack/extensions/blocks/publicize/store/actions.js
new file mode 100644
index 00000000..e5b71694
--- /dev/null
+++ b/plugins/jetpack/extensions/blocks/publicize/store/actions.js
@@ -0,0 +1,41 @@
+/**
+ * Returns an action object used in signalling that
+ * we're setting the Publicize connection test results.
+ *
+ * @param {Array} results Connection test results.
+ *
+ * @return {Object} Action object.
+ */
+export function setConnectionTestResults( results ) {
+ return {
+ type: 'SET_CONNECTION_TEST_RESULTS',
+ results,
+ };
+}
+
+/**
+ * Returns an action object used in signalling that
+ * we're refreshing the Publicize connection test results.
+ *
+ * @return {Object} Action object.
+ */
+export function refreshConnectionTestResults() {
+ return {
+ type: 'REFRESH_CONNECTION_TEST_RESULTS',
+ };
+}
+
+/**
+ * Returns an action object used in signalling that
+ * we're initiating a fetch request to the REST API.
+ *
+ * @param {String} path API endpoint path.
+ *
+ * @return {Object} Action object.
+ */
+export function fetchFromAPI( path ) {
+ return {
+ type: 'FETCH_FROM_API',
+ path,
+ };
+}