-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉
- Loading branch information
Showing
99 changed files
with
4,322 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
website/hugo-generated/ |
15 changes: 0 additions & 15 deletions
15
documentation/mvflow/net.pedroloureiro.mvflow/-m-v-flow/-view2/render.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Page not found 😱 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-GB"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.3/build/pure-min.css" | ||
integrity="sha384-cg6SkqEOCV1NbJoCu11+bm0NvBRc8IYLRGXkmNrqUBfTjmMYwNKPWBTIKyw9mHNJ" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.3/build/grids-responsive-min.css"> | ||
|
||
|
||
<link rel="stylesheet" href="/mvflow/css/github.css"> | ||
|
||
|
||
|
||
|
||
<link href="/mvflow/articles/index.xml" rel="alternate" type="application/rss+xml" title="MVFLow: a simple MVI library using Kotlin coroutines and flows"/> | ||
<link href="/mvflow/articles/index.xml" rel="feed" type="application/rss+xml" title="MVFLow: a simple MVI library using Kotlin coroutines and flows"/> | ||
|
||
|
||
|
||
|
||
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> | ||
|
||
<title>Articles</title> | ||
</head> | ||
<body> | ||
<div class="pure-g"><div class="pure-u-1 header-parent"> | ||
<div class="content header"> | ||
<div class="pure-menu pure-menu-horizontal"> | ||
<ul class="custom-menu-list pure-menu-list"> | ||
<li class="pure-menu-item"> | ||
|
||
<a href="https://pedroql.github.io/mvflow/" class="pure-menu-link">Home</a> | ||
|
||
</li> | ||
|
||
|
||
|
||
|
||
<li class="pure-menu-item"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<a href="https://pedroql.github.io/mvflow/articles/" class="pure-menu-link active">Articles</a> | ||
|
||
</li> | ||
<li class="pure-menu-item"> | ||
<a href="https://github.com/pedroql/mvflow" target="_blank" class="pure-menu-link">GitHub</a> | ||
</li> | ||
<li class="pure-menu-item"> | ||
|
||
<a href="https://pedroql.github.io/mvflow/documentation/mvflow/net.pedroloureiro.mvflow/" target="_blank" class="pure-menu-link">Documentation</a> | ||
|
||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
|
||
<div class="content pure-u-1"> | ||
|
||
|
||
|
||
<div id="content" > | ||
<article> | ||
<section> | ||
</section> | ||
<section class="section-listing"> | ||
|
||
<div class="section-item"> | ||
<div class=""> | ||
<h1 id="implementing-your-view-actions-flow">Implementing your view actions flow</h1> | ||
<p>MVFlow defines the view interface as follows:</p> | ||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-kotlin" data-lang="kotlin"><span style="color:#204a87;font-weight:bold">interface</span> <span style="color:#000">View</span><span style="color:#000;font-weight:bold"><</span><span style="color:#000">State</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">Action</span><span style="color:#000;font-weight:bold">></span> <span style="color:#000;font-weight:bold">{</span> | ||
|
||
<span style="color:#204a87;font-weight:bold">fun</span> <span style="color:#000">render</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">state</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">State</span><span style="color:#000;font-weight:bold">)</span> | ||
|
||
<span style="color:#204a87;font-weight:bold">fun</span> <span style="color:#000">actions</span><span style="color:#000;font-weight:bold">():</span> <span style="color:#000">Flow</span><span style="color:#000;font-weight:bold"><</span><span style="color:#000">Action</span><span style="color:#000;font-weight:bold">></span> | ||
<span style="color:#000;font-weight:bold">}</span> | ||
</code></pre></div><p>Most developers should have a reasonable idea of how to implement <code>render(state: State)</code>, but implementing | ||
<code>actions(): Flow<Action></code> might not seem so obvious if this is the first time you are implementing your own | ||
<a href="https://kotlinlang.org/docs/reference/coroutines/flow.html">Flow</a>.</p> | ||
<p>We can suggest three different ways to implement this, each with different pros and cons.</p> | ||
</div> | ||
|
||
|
||
<div class="section-item-link"> | ||
<a href="/mvflow/implementing-your-view-actions-flow/">Read More…</a> | ||
</div> | ||
|
||
</div> | ||
|
||
</section> | ||
|
||
</article> | ||
|
||
</div> | ||
</div><script> | ||
|
||
var elements = document.getElementsByTagName("pre"); | ||
function isHorizontallyScrollable(element) { | ||
return element.scrollWidth > element.clientWidth; | ||
}; | ||
var sidebar = document.querySelector(".sidebar"); | ||
function hideSidebarWhenHovered(element) { | ||
element.addEventListener('mouseenter', e => { | ||
sidebar.classList.add("hide-for-horizontal-scroll"); | ||
}); | ||
element.addEventListener('mouseleave', e => { | ||
sidebar.classList.remove("hide-for-horizontal-scroll"); | ||
}); | ||
}; | ||
Array.prototype.forEach.call(elements, function(el, i){ | ||
if(isHorizontallyScrollable(el)) { | ||
el.classList.add("expand"); | ||
hideSidebarWhenHovered(el); | ||
} | ||
}); | ||
</script> | ||
|
||
<script data-goatcounter="https://wi3r4gjn.goatcounter.com/count" | ||
async src="//gc.zgo.at/count.js"></script> | ||
<noscript> | ||
<img src="https://wi3r4gjn.goatcounter.com/count?p=/mvflow/articles/"> | ||
</noscript> | ||
|
||
<script src="https://unpkg.com/in-view@0.6.1/dist/in-view.min.js"></script> | ||
<script> | ||
|
||
var sidebarContent = document.querySelector(".toc-container.transparent"); | ||
if(sidebarContent != null) { | ||
var lastElement = null; | ||
const handleView = item => { | ||
const linkEl = document.querySelector(`a[href='#${item.id}']`); | ||
|
||
if(item.classList.contains("hide-from-toc")) { | ||
linkEl.classList.add("hide-from-toc"); | ||
return; | ||
} | ||
|
||
let offsetHeight = 0.6*(window.innerHeight); | ||
inView.offset({ | ||
bottom:offsetHeight | ||
}); | ||
|
||
inView(`#${item.id}`) | ||
.on("enter", () => { | ||
if( lastElement != null) { | ||
lastElement.classList.remove('active'); | ||
} | ||
if( linkEl != null) { | ||
linkEl.classList.add('active'); | ||
} | ||
lastElement = linkEl; | ||
}) | ||
}; | ||
|
||
|
||
document.querySelectorAll("#content h1, #content h2, #content h3").forEach(handleView); | ||
|
||
|
||
sidebarContent.classList.remove("transparent"); | ||
} | ||
</script> | ||
|
||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> | ||
<channel> | ||
<title>Articles on MVFLow: a simple MVI library using Kotlin coroutines and flows</title> | ||
<link>https://pedroql.github.io/mvflow/articles/</link> | ||
<description>Recent content in Articles on MVFLow: a simple MVI library using Kotlin coroutines and flows</description> | ||
<generator>Hugo -- gohugo.io</generator> | ||
<language>en-GB</language> | ||
<lastBuildDate>Wed, 12 Aug 2020 10:52:15 +0100</lastBuildDate> | ||
|
||
<atom:link href="https://pedroql.github.io/mvflow/articles/index.xml" rel="self" type="application/rss+xml" /> | ||
|
||
|
||
<item> | ||
<title>Implementing Your View Actions Flow</title> | ||
<link>https://pedroql.github.io/mvflow/implementing-your-view-actions-flow/</link> | ||
<pubDate>Wed, 12 Aug 2020 10:52:15 +0100</pubDate> | ||
|
||
<guid>https://pedroql.github.io/mvflow/implementing-your-view-actions-flow/</guid> | ||
<description><h1 id="implementing-your-view-actions-flow">Implementing your view actions flow</h1> | ||
<p>MVFlow defines the view interface as follows:</p> | ||
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-kotlin" data-lang="kotlin"><span style="color:#204a87;font-weight:bold">interface</span> <span style="color:#000">View</span><span style="color:#000;font-weight:bold">&lt;</span><span style="color:#000">State</span><span style="color:#000;font-weight:bold">,</span> <span style="color:#000">Action</span><span style="color:#000;font-weight:bold">&gt;</span> <span style="color:#000;font-weight:bold">{</span> | ||
|
||
<span style="color:#204a87;font-weight:bold">fun</span> <span style="color:#000">render</span><span style="color:#000;font-weight:bold">(</span><span style="color:#000">state</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000">State</span><span style="color:#000;font-weight:bold">)</span> | ||
|
||
<span style="color:#204a87;font-weight:bold">fun</span> <span style="color:#000">actions</span><span style="color:#000;font-weight:bold">():</span> <span style="color:#000">Flow</span><span style="color:#000;font-weight:bold">&lt;</span><span style="color:#000">Action</span><span style="color:#000;font-weight:bold">&gt;</span> | ||
<span style="color:#000;font-weight:bold">}</span> | ||
</code></pre></div><p>Most developers should have a reasonable idea of how to implement <code>render(state: State)</code>, but implementing | ||
<code>actions(): Flow&lt;Action&gt;</code> might not seem so obvious if this is the first time you are implementing your own | ||
<a href="https://kotlinlang.org/docs/reference/coroutines/flow.html">Flow</a>.</p> | ||
<p>We can suggest three different ways to implement this, each with different pros and cons.</p></description> | ||
</item> | ||
|
||
</channel> | ||
</rss> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html><head><title>https://pedroql.github.io/mvflow/articles/</title><link rel="canonical" href="https://pedroql.github.io/mvflow/articles/"/><meta name="robots" content="noindex"><meta charset="utf-8" /><meta http-equiv="refresh" content="0; url=https://pedroql.github.io/mvflow/articles/" /></head></html> |
Oops, something went wrong.