Method
onGot
(
keyOrType: KeyOrType,
fn: (data: EditorGetResult<T, KeyOrType>) => void,
)
Source from the content-addressed store, hash-verified
| 99 | */ |
| 100 | @action |
| 101 | onGot<T = undefined, KeyOrType extends EditorValueKey = any>( |
| 102 | keyOrType: KeyOrType, |
| 103 | fn: (data: EditorGetResult<T, KeyOrType>) => void, |
| 104 | ): () => void { |
| 105 | const x = this.context.get(keyOrType) |
| 106 | if (x !== undefined) { |
| 107 | fn(x) |
| 108 | } |
| 109 | this.setWait(keyOrType, fn) |
| 110 | return () => { |
| 111 | this.delWait(keyOrType, fn) |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * listen value when value is changed |
Callers
nothing calls this directly
Tested by
no test coverage detected