Skip to content

Conversation

@susnux
Copy link
Contributor

@susnux susnux commented Jun 14, 2024

This adds the native EventTarget class to the Navigation allowing to add listeners to it. Allowing to dispatch the updateActive event when the active navigation changed.

The idea is to make it reactive in a native / framework agnostic way.

@susnux susnux added type: enhancement 🚀 New feature or request 3. to review 3️⃣ Waiting for reviews labels Jun 14, 2024
@susnux susnux requested review from Pytal, ShGKme and skjnldsv June 14, 2024 11:18
@susnux susnux force-pushed the feat/allow-listening-active-view branch from 98e7d76 to 808ab7c Compare June 14, 2024 11:18
@codecov
Copy link

codecov bot commented Jun 14, 2024

Bundle Report

Changes will increase total bundle size by 1.63kB ⬆️

Bundle name Size Change
@nextcloud/files-esm 95.78kB 800 bytes ⬆️
@nextcloud/files-esm-cjs 96.87kB 828 bytes ⬆️

@skjnldsv
Copy link
Contributor

The idea is to make it reactive in a native / framework agnostic way.

Nice!
Though it seems a bit unknown for now, no?
Shall we add a bit more details like an example on the comments?

@susnux
Copy link
Contributor Author

susnux commented Jun 14, 2024

Though it seems a bit unknown for now, no?

In general it is now the same as with native JS / HTML element you can add / remove event listeners.

Shall we add a bit more details like an example on the comments?

I can add an example, yes :)

@susnux susnux force-pushed the feat/allow-listening-active-view branch from 808ab7c to 6b2dbbf Compare June 14, 2024 14:46
@susnux
Copy link
Contributor Author

susnux commented Jun 14, 2024

Examples added

This adds the native `EventTarget` class to the Navigation allowing to add listeners to it.
Allowing to dispatch the `updateActive` event when the active navigation changed.

The idea is to make it reactive in a native / framework agnostic way.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the feat/allow-listening-active-view branch from 6b2dbbf to c046d93 Compare June 14, 2024 14:50
@susnux susnux merged commit f4d3188 into main Jun 14, 2024
@susnux susnux deleted the feat/allow-listening-active-view branch June 14, 2024 16:16
@skjnldsv
Copy link
Contributor

skjnldsv commented Jul 3, 2024

Breaks stable28 & stable29 reactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review 3️⃣ Waiting for reviews type: enhancement 🚀 New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants