0
Follow
2
View

Passing function as parameter to a widget

GDL5211dht 注册会员
2023-01-26 06:33

Pass function with () invoking operator

funcion: (){
   SeguidoresCrud().dejarDeSeguir(documentIdSeguidores);
},
zongcailala 注册会员
2023-01-26 06:33

The problem is that you're the function, not it

Change to:

funcion: () => SeguidoresCrud().dejarDeSeguir(documentIdSeguidores),

This happens because when you pass the function using (), you're actually calling the function and passing it's return value as an argument not the function itself to be called elsewhere

About the Author

Question Info

Publish Time
2023-01-26 06:33
Update Time
2023-01-26 06:33

Related Question

Cassandra -分布式行锁定选择和更新

优化有太多连接和太多case的SQL查询

flash helper services 损坏的映像

gbase 8a 如何对字符集进行设置

写一个程序,打印ASCII字符1-225使用做while循环?

getOffsetsOnAssign如何工作?

如何解决线程限制超过替换阻塞工人错误时做httpclient sendAsync在java?

AspNetCore运行状况检查UI端点解析

asp.net点击asp:Repeater中的一个项,弹出一个遮罩层,显示该项的详细信息

是否有可能使用Rx“使用”操作符与IAsyncDisposable?