question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modifier without mixin

See original GitHub issue

I’d like to be able to use the underlying goodness of this addon in Octane mode using a modifier:

<div {{did-enter-viewport this.myCallback}}></div>

This would let me move my component to a native class component / glimmer components without mixins. I could also put myCallback in an Ember helper, and avoid a JS context for my component entirely.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mehulkarcommented, Aug 28, 2019

I had not seen that part of the README actually, thanks! But there are two features I’d still like:

  1. Support for template only components
  2. Auto wiring up the watchElement with the modifier, rather than having to use did-insert, select an element and bind the handler.

A “native” modifier, rather than using did-insert would solve both of these problems. The missing piece (at least to use the existing Service implementation) is to figure out how to inject a service into a modifier. I’m not sure if it’s possible to make a class-based modifier.

0reactions
snewcomercommented, Sep 23, 2019

Less complicated is better 👍 I like it so far.

Also, one thing to bring up is the act of watchElement for certain scenarios isn’t standard necessarily. For example, I might need to wait a tick to actually start watching the element in question (b/c say it is a content heavy page and the page doesn’t have height yet). Likely I wouldn’t be able to use it for the examples I have. Not necessarily needs to be taken into consideration for this modifier, but thought I would bring that up in case you come across solution in your exploration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BEM Mixins - CSS-Tricks
BEM – meaning block, element, modifier – is a front-end naming methodology thought up by the guys at Yandex. It is a smart...
Read more >
Features In-Depth | Less.js
Variables and mixins defined in a mixin are visible and can be used in caller's scope. There is only one exception: a variable...
Read more >
Pass argument to Sass BEM mixin to @extend parent
I need to apply the following modifiers to various classes within my app. I have written a mixin for this that looks like...
Read more >
Pushing BEM to the next level with Sass 3.4 | by Marc Mintel
You could not create a mixin that gets the name of a block and adds an element or modifier suffix, because the elements...
Read more >
Use BEM selectors with SASS - OpenClassrooms
This means creating a block__element--modifier selector, but since you've elevated the specificity of your element, you must also make sure that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found