Skip to content

Instantly share code, notes, and snippets.

@th0r
th0r / angular-in-view-directives.html
Last active February 9, 2023 17:45
Angular `InView` directives
<!-- wInViewRoot directive is needed to specify the `root` for `IntersectionObserver` and some other it's options e.g. `margin` -->
<div class="container" wInViewRoot="viewport">
Any content can be here
<w-in-view-item>
<!-- Content will be replaced by a placeholder <div> with the same height as original content.
Also `InViewItemComponent`s change detector will be detached when it become invisible which means
all the content's change detectors won't be reachable and will be inactive as well. -->
</w-in-view-item>
...or any other content can be here
<w-in-view-item>
@th0r
th0r / Fluxible promisify plugin
Last active August 29, 2015 14:14
Fluxible plugin that allows to use promise-style actions
var Bluebird = require('bluebird');
module.exports = function promisifyPlugin(options) {
options = options || {};
/**
* Makes promisified `executeAction` method
*
* @param {Object} actionContext
* @returns {Function}