Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(readme): explain role of ember-could-get-used-to-this better #189

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ npm install ember-statechart-component
yarn add ember-statechart-component
```

To be able to use XState [`state.matches`](https://xstate.js.org/docs/guides/states.html#state-matches-parentstatevalue)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding this! I like this as part of the installation instructions!

method in our templates,
we will first need a [HelperManager](https://github.com/emberjs/rfcs/pull/625) for
handling vanilla functions.
[ember-functions-as-helper-polyfill](https://github.com/NullVoxPopuli/ember-functions-as-helper-polyfill)
provides one:

```bash
ember install ember-functions-as-helper-polyfill
# or
npm install ember-functions-as-helper-polyfill
# or
yarn add ember-functions-as-helper-polyfill
```

Usage
------------------------------------------------------------------------------

Expand Down Expand Up @@ -104,14 +119,6 @@ Usage:

### Matching States

XState provides its own [`matches`](https://xstate.js.org/api/classes/state.html#matches)
method which is available on the `state` object.
We can utilize this provided there exists a `HelperManager` for
handling vanilla functions, such as what
[ember-could-get-used-to-this](https://github.com/pzuraq/ember-could-get-used-to-this)
provides.


```hbs
<Toggle as |state send|>
{{#if (state.matches 'inactive')}}
Expand Down