tinywidgets 1.1.1 → 1.1.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinywidgets",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinywidgets",
6
6
  "license": "MIT",
@@ -120,8 +120,8 @@ const TaskRunner = ({
120
120
  *
121
121
  * - `taskId`: a required string to identify the task by Id.
122
122
  * - `arg`: an optional string that will be passed to the task when run.
123
- * - `storeId`: an optional string that will be used to look up a Store by Id
124
- * in the current TinyBase Provider context and be passed to the task.
123
+ * - `storeId`: an optional string that will be used to look up a Store by Id in
124
+ * the current TinyBase Provider context and be passed to the task.
125
125
  *
126
126
  * @example
127
127
  * ```tsx
@@ -163,6 +163,31 @@ const TaskRunner = ({
163
163
  * ```
164
164
  * This example shows the hook returning a function that will schedule a task to
165
165
  * be run by the provider. That task in turn will call another.
166
+ * @example
167
+ * ```tsx
168
+ * const TaskButton3 = () => {
169
+ * const scheduleTask = useScheduleTask();
170
+ * return (<Button
171
+ * title="JSON"
172
+ * onClick={() => scheduleTask('json', '', 'store1')}
173
+ * />);
174
+ * };
175
+ * // ...
176
+ * <Provider storesById={{
177
+ * store1: useCreateStore(() =>
178
+ * createStore().setCell('pets', 'fido', 'species', 'dog')),
179
+ * }}>
180
+ * <TasksProvider tasks={{
181
+ * json: (_arg: string, store: Store | undefined) =>
182
+ * alert(store?.getJson()),
183
+ * }}>
184
+ * <TaskButton3 />
185
+ * </TasksProvider>
186
+ * </Provider>
187
+ * ```
188
+ * This example shows the hook returning a function that will schedule a task to
189
+ * be run by the provider, using a Store from the current context, specified by
190
+ * Id.
166
191
  */
167
192
  export const useScheduleTask = () => useContext(Context);
168
193