You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code snippet below, Store's run method invokes transactionObj.run and then shortly (probably fast enough for it to work) invokes transactionObj.throttle. Would it not be better to reverse the order of run and throttle?
@discardableResult@inlinable@inline(__always)publicfunc run<A:ActionProtocol,M>(
action:A,
mode:Dispatcher.Strategy=.async(nil),
throttle:TimeInterval=0,
handler:Dispatcher.TransactionCompletionHandler=nil)->Transaction<A>where A.AssociatedStoreType:Store<M>{lettransactionObj=transaction(action: action, mode: mode)
transactionObj.run(handler: handler)// RUN STARTED HERE
if throttle >TimeInterval.ulpOfOne {
transactionObj.throttle(throttle)// THROTTLING APPLIED HERE}return transactionObj
}
That is, instead of:
lettransactionObj=transaction(action: action, mode: mode)
transactionObj.run(handler: handler)// RUN STARTED HERE
if throttle >TimeInterval.ulpOfOne {
transactionObj.throttle(throttle)// THROTTLING APPLIED HERE}
use:
lettransactionObj=transaction(action: action, mode: mode)
if throttle >TimeInterval.ulpOfOne {
transactionObj.throttle(throttle)// THROTTLING APPLIED HERE}
transactionObj.run(handler: handler)// RUN STARTED HERE
?
The text was updated successfully, but these errors were encountered:
In the code snippet below,
Store
'srun
method invokestransactionObj.run
and then shortly (probably fast enough for it to work) invokestransactionObj.throttle
. Would it not be better to reverse the order ofrun
andthrottle
?That is, instead of:
use:
?
The text was updated successfully, but these errors were encountered: