pull/6528/head
Simon H 5 years ago committed by GitHub
parent d75bcb2abf
commit fd545cd29c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -198,6 +198,24 @@ Checks whether a given `key` has been set in the context of a parent component.
</script>
```
#### `getAllContexts`
```js
contexts: Map<any, any> = getAllContexts()
```
---
Retrieves the whole context map that belongs to the closest parent component. Must be called during component initialisation. Useful for example if you programmatically create a component and want to pass the existing context to it.
```sv
<script>
import { getAllContexts } from 'svelte';
const contexts = getAllContexts();
</script>
```
#### `createEventDispatcher`
```js

Loading…
Cancel
Save