Skip to content

Simple library for handling events through observer pattern

Notifications You must be signed in to change notification settings

VolpeIT/milestone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Volpe Observer

Install

npm i @volpe/milestone
yarn add @volpe/milestone

Usage

import { Event } from '@volpe/milestone'

// Create the event
const onclick = new Event()

// Add listeners
const handleOnClick = (e) => console.log('Click!')
onclick.listen(handleOnClick)

// Invoke event
window.addEventListener('click', onclick.invoke)

// Remove listener
onclick.remove(handleOnClick)

About

Simple library for handling events through observer pattern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published