@ydant/context 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +3 -3
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -55,7 +55,7 @@ Creates a context object that can be provided and injected.
55
55
  ### provide
56
56
 
57
57
  ```typescript
58
- function provide<T>(context: Context<T>, value: T): ContextProvide;
58
+ function* provide<T>(context: Context<T>, value: T): Primitive<ContextProvide>;
59
59
  ```
60
60
 
61
61
  Provides a value to all descendant components. Use with `yield*`.
@@ -63,7 +63,7 @@ Provides a value to all descendant components. Use with `yield*`.
63
63
  ### inject
64
64
 
65
65
  ```typescript
66
- function inject<T>(context: Context<T>): ContextInject;
66
+ function* inject<T>(context: Context<T>): Generator<ContextInject, T, T>;
67
67
  ```
68
68
 
69
69
  Retrieves the value from the nearest ancestor provider. Use with `yield*`. Returns the default value if no provider is found.
@@ -74,7 +74,7 @@ Retrieves the value from the nearest ancestor provider. Use with `yield*`. Retur
74
74
  function createContextPlugin(): Plugin;
75
75
  ```
76
76
 
77
- Creates a plugin that handles `provide` and `inject`. Must be passed to `mount()`.
77
+ Creates a plugin that handles `provide` and `inject`. Must be passed to `mount()`. Depends on `createBasePlugin()`.
78
78
 
79
79
  The context plugin extends `RenderContext` and `PluginAPI`:
80
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ydant/context",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Context API for Ydant",
5
5
  "keywords": [
6
6
  "context",
@@ -39,8 +39,8 @@
39
39
  }
40
40
  },
41
41
  "peerDependencies": {
42
- "@ydant/base": "0.1.0",
43
- "@ydant/core": "0.1.0"
42
+ "@ydant/core": "0.1.1",
43
+ "@ydant/base": "0.1.2"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "vite build",