mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: handle updater’s return value
This commit is contained in:
parent
2ebd8c8fa7
commit
9be44e4e73
1 changed files with 2 additions and 4 deletions
|
|
@ -22,11 +22,9 @@ function link(instance, sources) {
|
|||
// luckily I don't need them :)
|
||||
let [updater, callback] = args
|
||||
if (typeof updater === 'function') {
|
||||
callback = updater
|
||||
callback(instance.state, instance.props)
|
||||
} else {
|
||||
instance.setState(updater, callback)
|
||||
updater = updater(instance.state, instance.props)
|
||||
}
|
||||
instance.setState(updater, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue