一个动作如何更新多个不同的减速器?我该如何实施?
更新:
这是我在./actions/sync.js中的操作。此操作会定期连接到外部API并从同步组件进行调用。
export function syncFetch(response) {
return {
type: 'SYNC_FETCH',
response
}
}
export function syncFetchData(url) {
return (dispatch) => {
fetch(url)
.then((response) => {
if (!response.ok) {
throw Error(response.statusText);
}
return response;
})
.then((response) => response.json())
.then((sync) => updateAll(sync))
.catch(() => console.log('error'));
};
}
const updateAll = (params) => {
return dispatch => {
dispatch({type: 'SYNC_FETCH', payload: params})
}
}
Run Code Online (Sandbox Code Playgroud)
和./reducers/sync.js
const initialState = [];
export default (state = initialState, action) => {
switch(action.type) {
case 'SYNC_FETCH':
return …Run Code Online (Sandbox Code Playgroud) 我想在带有 PHP 7.3 的 Windows 10 中安装 AMQP,以便在 symfony 4 中使用。Windows 不使用任何 apache/iis/nginx 并直接由 symfony 运行。
一切还好!直到,我决定在项目中使用rabbitmq并且需要amqp。
因此,1. 下载AMQP 1.9.4(兼容 php 7.3)
2. 将 php_amqp.dll 复制到 c:\php
3. 复制 rabbitmq.4.dll(兼容 AMQP 1.9.4)到 c:\windows\system32
4. 添加extension=php_amqp.dll > php.ini
5. php.ini extension_dir = "ext"
但我收到此错误:
PHP Warning:
PHP Startup: Unable to load dynamic library 'php_amqp.dll'
(tried: ext\php_amqp.dll (The specified module could not be found.),
ext\php_php_amqp.dll.dll (The specified module could not be found.)) in Unknown on line 0
Run Code Online (Sandbox Code Playgroud)
我尝试以下说明:
1. 将 …