react-router browserHistory removeListen?

时间:2016-04-25 21:55:18

标签: reactjs react-router

我使用

订阅路线更改
browserHistory.listen(fn)

但我如何取消订阅?

我尝试过分配给listen null,但它抱怨自己不是一个功能。

1 个答案:

答案 0 :(得分:7)

Sub Solver_Balances() 'Automated solver to calculate the mass and heat balance 'at each time increment of 1 sec as given by the datalogger ' Worksheets("Sheet1").Activate RowCount = 2 Do While Not IsEmpty(Worksheets("Sheet1").Range("H" & RowCount)) SolverReset SolverOk SetCell:="P" & RowCount, MaxMinVal:=2, ValueOf:=0, _ ByChange:="H" & RowCount, Engine:=1, _ EngineDesc:="GRG Nonlinear" SolverAdd CellRef:="H" & RowCount, _ Relation:=1, _ FormulaText:="H" & RowCount - 1 SolverAdd CellRef:="L" & RowCount, _ Relation:=3, _ FormulaText:="L" & RowCount - 1 SolverSolve userfinish:=True SolverFinish keepFinal:=1 RowCount = RowCount + 1 Loop End Sub 返回的是一个在调用时取消订阅侦听器的函数。所以只需保存以供日后使用:

listen