Skip to content

Commit

Permalink
fix: added action & context
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelOsborne committed Aug 7, 2023
1 parent 639786a commit 7d2751c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-comics-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dotlottie/dotlottie-js": patch
---

added context and action types
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"four-plums-obey",
"friendly-windows-rush",
"great-actors-arrive",
"green-comics-guess",
"late-shirts-mix",
"many-chicken-hear",
"old-ghosts-explain",
Expand Down
6 changes: 6 additions & 0 deletions packages/dotlottie-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @dotlottie/dotlottie-js

## 0.4.0-beta.16

### Patch Changes

- added context and action types

## 0.4.0-beta.15

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/dotlottie-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dotlottie/dotlottie-js",
"version": "0.4.0-beta.15",
"version": "0.4.0-beta.16",
"type": "module",
"description": "This library helps in creating and modifying .lottie files.",
"repository": {
Expand Down
12 changes: 10 additions & 2 deletions packages/dotlottie-js/src/common/dotlottie-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,17 @@ export interface XState {
on: Record<keyof EventMap, XStateTargetEvent>;
}

export interface XStateMachineContext {
counter: number;
}

export interface XStateMachineAction {
incrementCounter: (context: XStateMachineContext) => void;
}

export interface XStateMachine {
actions: Record<string, unknown>;
context: Record<string, unknown>;
actions: XStateMachineAction;
context: XStateMachineContext;
guards: Record<string, unknown>;
id: string;
initial: string;
Expand Down

0 comments on commit 7d2751c

Please sign in to comment.