Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwray committed Oct 15, 2024
1 parent 6f58fcf commit bc5556c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ if you are not using ESM modules, you can use the following:
</script>
```

# API
# API - Hooks

## .onHook(eventName, handler)

Expand All @@ -143,6 +143,8 @@ Get all hooks for an event.

## .clearHooks(eventName)

# API - Events

## .on(eventName, handler)

Subscribe to an event.
Expand All @@ -167,6 +169,30 @@ Remove all listeners for an event.

Set the maximum number of listeners and will truncate if there are already too many.

## .once(eventName, handler)

Subscribe to an event once.

## .prependListener(eventName, handler)

Prepend a listener to an event.

## .prependOnceListener(eventName, handler)

Prepend a listener to an event once.

## .eventNames()

Get all event names.

## .listenerCount(eventName?)

Get the count of listeners for an event or all events if evenName not provided.

## .rawListeners(eventName?)

Get all listeners for an event or all events if evenName not provided.

# Development and Testing

Hookified is written in TypeScript and tests are written in `vitest`. To run the tests, use the following command:
Expand Down

0 comments on commit bc5556c

Please sign in to comment.