我有一个带有组件的模块,该组件调度一个FETCH动作,该动作从API获取数据,然后调度一个RECEIVED动作。 运行正常。
然后,我将模型,操作和状态复制到另一个模块和组件(具有不同的获取和接收),并且它不起作用。记录器显示已分派的操作,但未执行代码。
documents.action.ts
this.authenticationContext.getCachedUser();
this.authenticationContext.acquireToken(config.clientId, function (errorDesc, token) {
if (errorDesc) {
console.log("ErrorDesc", errorDesc);
}
if (token) {
console.log("calling the Web API with the access token", token);
}
});
documents.state.ts
header <- dashboardHeader(
title = "Analysis Project"
)
sidebar <- dashboardSidebar(
menuItem(text = "Importing file", tabName = "dashboard",icon = icon("file"),
menuSubItem(text = "Importing file", tabName = "dataset")
),
menuItem("Dashboard", tabName = "dashboard"),
menuItem("Filter Page"),
menuItem("Data")
)
body <- dashboardBody(
fluidPage(
tabItems(
tabItem(tabName = "dataset",
fluidRow(
box(width = 12,
fileInput(inputId = "file",
label = "Choose a file",
accept = c(".xlsx",".csv")
),
tableOutput(outputId = "Contents"),
verbatimTextOutput(outputId = "Data")
)
)
)
)
)
)
ui <- dashboardPage(header = header,
sidebar = sidebar,
body = body)
server <- function(input, output, session) {
output$Data <- renderPrint({
if(is.null(input$file)){
print("Import Excel data file")
} else {
inFile <- input$file
df <- read_excel(inFile$datapath)
print(df)
}
})
}
shinyApp(ui = ui, server = server)
我已将代码减少到最少,以检查一切是否正常运行。还检查了导入(有时我从错误的lib获取了导入),仍然没有运气。
有什么想法吗?
答案 0 :(得分:0)
所以我缺少的一点是将其声明给模块
export class FetchFolders {
static readonly type = '[Documents] Fetch folders';
constructor(public payload: string) { }
}