Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about supporting object depth when using function properties? #167

Open
twoshlove opened this issue Jan 24, 2024 · 0 comments
Open

How about supporting object depth when using function properties? #167

twoshlove opened this issue Jan 24, 2024 · 0 comments

Comments

@twoshlove
Copy link

A namespace is needed because your plugin uses a global function.

In the current structure, only window 1depth objects can be registered.

parse: (value, attribute, element) => {
    const fn = (() => {
      if (typeof window !== "undefined" && value in window) {
        // @ts-expect-error
        return window[value] // only window 1depth objects can be registered!!
      }

      if (typeof global !== "undefined" && value in global) {
        // @ts-expect-error
        return global[value]
      }
    })()

    return typeof fn === "function" ? fn.bind(element) : undefined
  },

It would be nice to modify this part so that it can be defined as N depth.

<custom-ele func="action" /> ( O )
<custom-ele func="ns.action" /> ( X )
<custom-ele func="ns.action.get" /> ( X )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant