actions.js
4 years ago
controls.js
5 years ago
index.js
5 years ago
reducer.js
2 years ago
resolvers.js
4 years ago
selectors.js
4 years ago
actions.js
186 lines
| 1 | export function setPresetLoading(value) { |
| 2 | return { |
| 3 | type: "SET_PRESET_LOADING", |
| 4 | value, |
| 5 | }; |
| 6 | } |
| 7 | |
| 8 | export function setVideosLoading(value) { |
| 9 | return { |
| 10 | type: "SET_VIDEOS_LOADING", |
| 11 | value, |
| 12 | }; |
| 13 | } |
| 14 | |
| 15 | export function setProModal(value) { |
| 16 | return { |
| 17 | type: "SET_PRO_MODAL", |
| 18 | value, |
| 19 | }; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Videos |
| 24 | */ |
| 25 | export function setVideos(value) { |
| 26 | return { |
| 27 | type: "SET_VIDEOS", |
| 28 | value, |
| 29 | }; |
| 30 | } |
| 31 | export function updateVideos(value) { |
| 32 | return { |
| 33 | type: "UPDATE_VIDEOS", |
| 34 | value, |
| 35 | }; |
| 36 | } |
| 37 | export function appendVideos(value) { |
| 38 | return { |
| 39 | type: "APPEND_VIDEOS", |
| 40 | value, |
| 41 | }; |
| 42 | } |
| 43 | export function addVideo(value) { |
| 44 | return { |
| 45 | type: "ADD_VIDEO", |
| 46 | value, |
| 47 | }; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Presets |
| 52 | */ |
| 53 | export function setPresets(value) { |
| 54 | return { |
| 55 | type: "SET_PRESET", |
| 56 | value, |
| 57 | }; |
| 58 | } |
| 59 | export function addPreset(value) { |
| 60 | return { |
| 61 | type: "ADD_PRESET", |
| 62 | value, |
| 63 | }; |
| 64 | } |
| 65 | export function updatePreset(value) { |
| 66 | return { |
| 67 | type: "UPDATE_PRESET", |
| 68 | value, |
| 69 | }; |
| 70 | } |
| 71 | export function removePreset(value) { |
| 72 | return { |
| 73 | type: "REMOVE_PRESET", |
| 74 | value, |
| 75 | }; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Audio Presets |
| 80 | */ |
| 81 | |
| 82 | export function setAudioPresets(value) { |
| 83 | return { |
| 84 | type: "SET_AUDIO_PRESET", |
| 85 | value, |
| 86 | }; |
| 87 | } |
| 88 | |
| 89 | export function addAudioPreset(value) { |
| 90 | return { |
| 91 | type: "ADD_AUDIO_PRESET", |
| 92 | value, |
| 93 | }; |
| 94 | } |
| 95 | export function updateAudioPreset(value) { |
| 96 | return { |
| 97 | type: "UPDATE_AUDIO_PRESET", |
| 98 | value, |
| 99 | }; |
| 100 | } |
| 101 | export function removeAudioPreset(value) { |
| 102 | return { |
| 103 | type: "REMOVE_AUDIO_PRESET", |
| 104 | value, |
| 105 | }; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Branding |
| 110 | */ |
| 111 | export function setBranding(value) { |
| 112 | return { |
| 113 | type: "SET_BRANDING", |
| 114 | value, |
| 115 | }; |
| 116 | } |
| 117 | export function updateBranding(name, value) { |
| 118 | return { |
| 119 | type: "UPDATE_BRANDING", |
| 120 | name, |
| 121 | value, |
| 122 | }; |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * Save provided settings |
| 127 | */ |
| 128 | export function saveOptions(args) { |
| 129 | return { |
| 130 | type: "SAVE_OPTIONS", |
| 131 | ...args, |
| 132 | }; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * FetchOptions |
| 137 | */ |
| 138 | export function fetchOptions() { |
| 139 | return { |
| 140 | type: "FETCH_OPTIONS", |
| 141 | }; |
| 142 | } |
| 143 | |
| 144 | export function fetchFromAPI(path) { |
| 145 | return { |
| 146 | type: "FETCH_FROM_API", |
| 147 | path, |
| 148 | }; |
| 149 | } |
| 150 | |
| 151 | export function fetchFromWPAPI(path, args) { |
| 152 | return { |
| 153 | type: "FETCH_FROM_WP_API", |
| 154 | path, |
| 155 | args, |
| 156 | }; |
| 157 | } |
| 158 | |
| 159 | export function setYoutube(value) { |
| 160 | return { |
| 161 | type: "SET_YOUTUBE", |
| 162 | value, |
| 163 | }; |
| 164 | } |
| 165 | |
| 166 | export function updateYoutube(name, value) { |
| 167 | return { |
| 168 | type: "UPDATE_YOUTUBE", |
| 169 | name, |
| 170 | value, |
| 171 | }; |
| 172 | } |
| 173 | |
| 174 | export function setPresetSettings(value) { |
| 175 | return { |
| 176 | type: "SET_PRESET_SETTINGS", |
| 177 | value, |
| 178 | }; |
| 179 | } |
| 180 | |
| 181 | export function setPresetAudioSettings(value) { |
| 182 | return { |
| 183 | type: "SET_PRESET_AUDIO_SETTINGS", |
| 184 | value, |
| 185 | }; |
| 186 | } |