Skip to content

Commit

Permalink
doc: wrap some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tchak committed Jul 22, 2023
1 parent 8180e1b commit b37d0ef
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ package.
import * as Actions from '@coldwired/actions';

const actions = new Actions.Actions({ element: document.body });

addEventListener('DOMContentLoaded', () => {
actions.observe();
});
actions.observe();

const fragment = document.createDocumentFragment();
fragment.append(document.createTextNode('<p>Hello World</p>'));
Expand All @@ -54,7 +51,8 @@ fragment.append(document.createTextNode('<p>Hello World</p>'));
actions.after({ targets: '.item', fragment: '<p>Hello World</p>' });
actions.after({ targets: '.item', fragment });

// If you want to dispatch actions from places where you don't have access to the `Actions` instance.
// If you want to dispatch actions from places where you don't have access to the `Actions`
// instance.
Actions.after({ targets: '.item', fragment });

// Insert a fragment before each target element
Expand Down Expand Up @@ -104,7 +102,8 @@ actions.applyActions([
},
])

// Same as `applyActions` but if you want to dispatch actions from places where you don't have access to the `Actions` instance.
// Same as `applyActions` but if you want to dispatch actions from places where you don't have
// access to the `Actions` instance.
Actions.dispatchActions([
{
action: 'update',
Expand All @@ -116,5 +115,4 @@ Actions.dispatchActions([
targets: '.item-to-remove',
},
]);

```

0 comments on commit b37d0ef

Please sign in to comment.