@Injectable()
export class ApiSearchEffects {
@Effect()
search$: Observable<any>
= this.actions$
.ofType(query.ActionTypes.QUERYSERVER)
.debounceTime(300)
.map((action: query.QueryServerAction) => action.payload)
.switchMap(payload => {
console.log(payload);
const nextSearch$ = this.actions$.ofType(query.ActionTypes.QUERYSERVER).skip(1);
this.searchService.getsearchresults(payload)
.takeUntil(nextSearch$)
.map((response) =>
({type: '[Search] Change', payload: response}
))
});
Run Code Online (Sandbox Code Playgroud)
上面的代码给了我 '(payload: any) => void' 类型的参数不能分配给类型 '(value: any, index: number) => ObservableInput' 的参数。“void”类型不能分配给“ObservableInput”类型。哪里可能出错。我遵循了https://github.com/ngrx/effects/blob/master/docs/intro.md 上的 ngrx 效果官方介绍。
如何让https://xr-spinosaurus.glitch.me/在 React Native WebView 组件中工作?
import React, { Component } from 'react';
import { WebView } from 'react-native';
export default class MyWeb extends Component {
render() {
return (
<WebView
source={{uri: 'https://xr-spinosaurus.glitch.me/'}}
style={{marginTop: 20}}
/>
);
}
}
Run Code Online (Sandbox Code Playgroud)
现在将此添加到 react-native 仅显示 VR 选项,而不显示 AR 选项。
如果您直接访问链接,您可以看到 VR 和 AR 选项,但在 React-Native 内的 Web 视图组件中运行时我找不到 AR 选项但是如果我直接访问支持的 ARCore 上的链接,则可以使用相同的 AR 选项设备。
如何让这段代码也显示 React-Native 中的 AR 选项?
我正在练习c并在主函数执行之前面临分段错误("hi"不打印,甚至gdb没有提到错误行,除了调用来自main函数).有人可以帮助我从哪里出错?我尝试在网上找出并冲浪错误但无法找到我所拥有的代码类型.
#include<stdio.h>
int main(){
printf("hi");
double L,dx,dy,dt;
scanf("%lf %lf %lf %lf",&L,&dx,&dy,&dt);
int i,j;
int x=L/dx;
int y=L/dy;
double ar[1000][1000];
double o1=x/2;
double o2=y/2;
int D=2;
double den[1000][1000];
double den1[1000][1000];
//printf("hi");
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
{
if(i==o1 && j==o2)
{
ar[i][j]=1;
den[i][j]=1;
}
else
{
ar[i][j]=0;
den[i][j]=0;
}
}
}
//printf("hi");
for(i=1;i<x-2;i++)
{
for(j=1;j<y-2;j++)
{
den1[i][j]=den[i][j]+((den[i+1][j]-den[i][j]+den[i-1][j]-den[i][j])/dx*dx+(den[i][j+1]-den[i][j]+den[i][j-1]-den[i][j])/dy*dy
)*dt+((den[i+1][j]-den[i][j]+den[i-1][j]-den[i][j])/dx*dx+(den[i][j+1]-den[i][j]+den[i][j-1]-den[i][j])/dy*dy)*dt;
}
}
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
{
printf("%lf",ar[i][j]);
}
printf("\n");
}
printf("\n");
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
{
printf("%lf",den1[i][j]);
}
printf("\n");
}
printf("\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud) aframe ×1
angular ×1
c ×1
ngrx ×1
ngrx-effects ×1
ngrx-store ×1
react-native ×1
rxjs ×1
webview ×1
webxr ×1