Update 03-run-time.md

pull/5690/head
pushkin 5 years ago committed by GitHub
parent 881a0ca94d
commit 610db737ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -178,6 +178,26 @@ Retrieves the context that belongs to the closest parent component with the spec
</script>
```
#### `hasContext`
```js
hasContext(key: any)
```
---
Checks whether a given `key` has been set. Must be called during component initialisation.
```sv
<script>
import { hasContext } from 'svelte';
if (hasContext('answer')) {
}
</script>
```
#### `createEventDispatcher`
```js

Loading…
Cancel
Save