Skip to content

Implement hooks system #22

@D34DPlayer

Description

@D34DPlayer

CRUD?
EventEmitter?

DB events

Table events

Extra

Could we use BroadcastChannel, so that changes on any tab trigger hooks on every tab? It should be clear where the action actually takes place to do actual modifications rather than just listening in:

// Will trigger only if action in current tab
User.hook("beforeUpdate", async (element) => {
    element.version += 1
})
// Will trigger on all tabs
User.hook("afterUpdate", async () => {
    fetchUsers()
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions