Skip to content

Commit

Permalink
Deploying to gh-pages from @ 156ff58 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmloff committed Oct 24, 2023
1 parent a6ff837 commit aaf691a
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 38 deletions.
40 changes: 20 additions & 20 deletions assets/dioxus/docsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function logError(f, args) {
function __wbg_adapter_48(arg0, arg1) {
_assertNum(arg0);
_assertNum(arg1);
wasm.wasm_bindgen__convert__closures__invoke0_mut__h43970e4017064ea3(arg0, arg1);
wasm.wasm_bindgen__convert__closures__invoke0_mut__hfb09d683666c9a1c(arg0, arg1);
}

let stack_pointer = 128;
Expand All @@ -280,7 +280,7 @@ function __wbg_adapter_51(arg0, arg1, arg2) {
try {
_assertNum(arg0);
_assertNum(arg1);
wasm.wasm_bindgen__convert__closures__invoke1_mut_ref__h3fa10d020be0a616(arg0, arg1, addBorrowedObject(arg2));
wasm.wasm_bindgen__convert__closures__invoke1_mut_ref__hf62ce91e3249615e(arg0, arg1, addBorrowedObject(arg2));
} finally {
heap[stack_pointer++] = undefined;
}
Expand Down Expand Up @@ -310,7 +310,7 @@ function makeClosure(arg0, arg1, dtor, f) {
function __wbg_adapter_54(arg0, arg1, arg2) {
_assertNum(arg0);
_assertNum(arg1);
wasm.wasm_bindgen__convert__closures__invoke1__h23382e5e31c327f1(arg0, arg1, addHeapObject(arg2));
wasm.wasm_bindgen__convert__closures__invoke1__h38a0bad80552daaf(arg0, arg1, addHeapObject(arg2));
}

function __wbg_adapter_57(arg0, arg1) {
Expand All @@ -322,7 +322,7 @@ function __wbg_adapter_57(arg0, arg1) {
function __wbg_adapter_60(arg0, arg1, arg2) {
_assertNum(arg0);
_assertNum(arg1);
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h02d94f27469090d0(arg0, arg1, addHeapObject(arg2));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h37677ca506cba9e5(arg0, arg1, addHeapObject(arg2));
}

function __wbg_adapter_63(arg0, arg1, arg2) {
Expand All @@ -335,7 +335,7 @@ function __wbg_adapter_66(arg0, arg1, arg2) {
try {
_assertNum(arg0);
_assertNum(arg1);
wasm.wasm_bindgen__convert__closures__invoke1_mut_ref__ha08dca46a0d225e2(arg0, arg1, addBorrowedObject(arg2));
wasm.wasm_bindgen__convert__closures__invoke1_mut_ref__h7dbbcb86e6e5e7d3(arg0, arg1, addBorrowedObject(arg2));
} finally {
heap[stack_pointer++] = undefined;
}
Expand Down Expand Up @@ -555,6 +555,11 @@ imports.wbg.__wbg_fetch_b5d6bebed1e6c2d2 = function() { return logError(function
const ret = fetch(getObject(arg0));
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
_assertBoolean(ret);
return ret;
};
imports.wbg.__wbindgen_number_new = function(arg0) {
const ret = arg0;
return addHeapObject(ret);
Expand All @@ -577,11 +582,6 @@ imports.wbg.__wbg_setTimeout_75cb9b6991a4031d = function() { return handleError(
const ret = setTimeout(getObject(arg0), arg1);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbindgen_is_string = function(arg0) {
const ret = typeof(getObject(arg0)) === 'string';
_assertBoolean(ret);
return ret;
};
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
const ret = getObject(arg0) == getObject(arg1);
_assertBoolean(ret);
Expand Down Expand Up @@ -1514,24 +1514,24 @@ imports.wbg.__wbindgen_closure_wrapper518 = function() { return logError(functio
const ret = makeMutClosure(arg0, arg1, 87, __wbg_adapter_51);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbindgen_closure_wrapper5760 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1655, __wbg_adapter_54);
imports.wbg.__wbindgen_closure_wrapper5706 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1667, __wbg_adapter_54);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbindgen_closure_wrapper5835 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1677, __wbg_adapter_57);
imports.wbg.__wbindgen_closure_wrapper5782 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1689, __wbg_adapter_57);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbindgen_closure_wrapper5883 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1684, __wbg_adapter_60);
imports.wbg.__wbindgen_closure_wrapper5831 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1696, __wbg_adapter_60);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbindgen_closure_wrapper5897 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1695, __wbg_adapter_63);
imports.wbg.__wbindgen_closure_wrapper5844 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1707, __wbg_adapter_63);
return addHeapObject(ret);
}, arguments) };
imports.wbg.__wbindgen_closure_wrapper6143 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1773, __wbg_adapter_66);
imports.wbg.__wbindgen_closure_wrapper6090 = function() { return logError(function (arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1786, __wbg_adapter_66);
return addHeapObject(ret);
}, arguments) };
imports['./snippets/dioxus-interpreter-js-603636eeca72cf05/inline0.js'] = __wbg_star0;
Expand Down
Binary file modified assets/dioxus/docsite_bg.wasm
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ let m,p,ls,d,t,op,i,e,z,metaflags;
else{
return evt[evt_tmp2&4294967167];
}
}let s = "";let lsp,sp,sl; let c = new TextDecoder();let u32buf,u32bufp;let u8buf,u8bufp;const ns_cache = [];
}let s = "";let lsp,sp,sl; let c = new TextDecoder();const ns_cache = [];
let ns_cache_tmp1, ns_cache_tmp2;
function get_ns_cache() {
ns_cache_tmp2 = u8buf[u8bufp++];
Expand All @@ -199,8 +199,8 @@ let m,p,ls,d,t,op,i,e,z,metaflags;
else{
return ns_cache[ns_cache_tmp2&4294967167];
}
}
let id,ptr,event_name,len,value,field,bubbles,ns;
}let u8buf,u8bufp;let u32buf,u32bufp;
let bubbles,id,value,len,ptr,event_name,ns,field;
export function create(r){
d=r;
}
Expand Down Expand Up @@ -239,13 +239,13 @@ let m,p,ls,d,t,op,i,e,z,metaflags;
s = c.decode(new DataView(m.buffer, lsp, sl));
}
}
sp=0;if ((metaflags>>>3)&1){
u32buf=new Uint32Array(m.buffer,m.getUint32(d+3*4,true))
}
u32bufp=0;if ((metaflags>>>5)&1){
sp=0;if ((metaflags>>>5)&1){
u8buf=new Uint8Array(m.buffer,m.getUint32(d+5*4,true))
}
u8bufp=0;
u8bufp=0;if ((metaflags>>>3)&1){
u32buf=new Uint32Array(m.buffer,m.getUint32(d+3*4,true))
}
u32bufp=0;
for(;;){
op=m.getUint32(p,true);
p+=4;
Expand Down
2 changes: 1 addition & 1 deletion learn/0.4/cookbook/integrations/index.html

Large diffs are not rendered by default.

72 changes: 71 additions & 1 deletion learn/0.4/cookbook/integrations/internationalization/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions learn/0.4/guide/state/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
</span><span style="color:#c0c5ce;">}
</span><span style="color:#c0c5ce;">
</span></pre>
</div><button style="position: absolute; top: 0; right: 0; background: rgba(0, 0, 0, 0.75); color: white; border: 1px solid white; padding: 0.25em;" onclick="navigator.clipboard.writeText(this.previousElementSibling.innerText)">Copy</button></div><div class="bg-white rounded-md shadow-md p-4 my-4 overflow-scroll text-black dioxus-demo" style="max-height:50vh;"><style>.dioxus-demo div { all: revert; }.dioxus-demo input { all: revert; }.dioxus-demo form { all: revert; }</style><div style="display:flex;flex-direction:row;width:100%;"><div style="width:50%;"><div style="padding:0.5rem;position:relative;"><div style="font-size:1.5rem;"><a href=""><!--#-->hello hackernews<!--#--></a><a href="https://news.ycombinator.com/from?site=" style="color:gray;text-decoration:none;"><!--#--> ()<!--#--></a></div><div style="display:flex;flex-direction:row;color:gray;"><div><!--#-->0 points<!--#--></div><div style="padding-left:0.5rem;"><!--#-->by Author<!--#--></div><div style="padding-left:0.5rem;"><!--#-->10/16/23 3:59 PM<!--#--></div><div style="padding-left:0.5rem;"><!--#-->0 comments<!--#--></div></div></div></div><div style="width:50%;">Hover over a story to preview it here</div></div></div><h2 id="event-handlers"><a class="header" href="#event-handlers">Event Handlers</a></h2><p>Next, we need to detect when the user hovers over a section or focuses a link. We can use an <a href="../reference/event_handlers">event listener</a> to listen for the hover and focus events.</p><p>Event handlers are similar to regular attributes, but their name usually starts with <code>on</code>- and they accept closures as values. The closure will be called whenever the event it listens for is triggered. When an event is triggered, information about the event is passed to the closure though the <a href="https://docs.rs/dioxus/latest/dioxus/prelude/struct.Event.html">Event</a> structure.</p><p>Let&#x27;s create a <a href="https://docs.rs/dioxus/latest/dioxus/events/fn.onmouseenter.html"><code>onmouseenter</code></a> event listener in the StoryListing component:</p><div style="position: relative;"><div><pre style="background-color:#2b303b;">
</div><button style="position: absolute; top: 0; right: 0; background: rgba(0, 0, 0, 0.75); color: white; border: 1px solid white; padding: 0.25em;" onclick="navigator.clipboard.writeText(this.previousElementSibling.innerText)">Copy</button></div><div class="bg-white rounded-md shadow-md p-4 my-4 overflow-scroll text-black dioxus-demo" style="max-height:50vh;"><style>.dioxus-demo div { all: revert; }.dioxus-demo input { all: revert; }.dioxus-demo form { all: revert; }</style><div style="display:flex;flex-direction:row;width:100%;"><div style="width:50%;"><div style="padding:0.5rem;position:relative;"><div style="font-size:1.5rem;"><a href=""><!--#-->hello hackernews<!--#--></a><a href="https://news.ycombinator.com/from?site=" style="color:gray;text-decoration:none;"><!--#--> ()<!--#--></a></div><div style="display:flex;flex-direction:row;color:gray;"><div><!--#-->0 points<!--#--></div><div style="padding-left:0.5rem;"><!--#-->by Author<!--#--></div><div style="padding-left:0.5rem;"><!--#-->10/24/23 6:09 PM<!--#--></div><div style="padding-left:0.5rem;"><!--#-->0 comments<!--#--></div></div></div></div><div style="width:50%;">Hover over a story to preview it here</div></div></div><h2 id="event-handlers"><a class="header" href="#event-handlers">Event Handlers</a></h2><p>Next, we need to detect when the user hovers over a section or focuses a link. We can use an <a href="../reference/event_handlers">event listener</a> to listen for the hover and focus events.</p><p>Event handlers are similar to regular attributes, but their name usually starts with <code>on</code>- and they accept closures as values. The closure will be called whenever the event it listens for is triggered. When an event is triggered, information about the event is passed to the closure though the <a href="https://docs.rs/dioxus/latest/dioxus/prelude/struct.Event.html">Event</a> structure.</p><p>Let&#x27;s create a <a href="https://docs.rs/dioxus/latest/dioxus/events/fn.onmouseenter.html"><code>onmouseenter</code></a> event listener in the StoryListing component:</p><div style="position: relative;"><div><pre style="background-color:#2b303b;">
<span style="color:#c0c5ce;">cx.</span><span style="color:#96b5b4;">render</span><span style="color:#c0c5ce;">(rsx! {
</span><span style="color:#c0c5ce;"> div {
</span><span style="color:#c0c5ce;"> padding: &quot;</span><span style="color:#a3be8c;">0.5rem</span><span style="color:#c0c5ce;">&quot;,
Expand Down Expand Up @@ -353,7 +353,7 @@
</span><span style="color:#c0c5ce;"> </span><span style="color:#65737e;">// New
</span><span style="color:#c0c5ce;"> </span><span style="color:#b48ead;">match </span><span style="color:#c0c5ce;">&amp;*preview_state.</span><span style="color:#96b5b4;">read</span><span style="color:#c0c5ce;">() {
</span></pre>
</div><button style="position: absolute; top: 0; right: 0; background: rgba(0, 0, 0, 0.75); color: white; border: 1px solid white; padding: 0.25em;" onclick="navigator.clipboard.writeText(this.previousElementSibling.innerText)">Copy</button></div><div class="bg-white rounded-md shadow-md p-4 my-4 overflow-scroll text-black dioxus-demo" style="max-height:50vh;"><style>.dioxus-demo div { all: revert; }.dioxus-demo input { all: revert; }.dioxus-demo form { all: revert; }</style><div style="display:flex;flex-direction:row;width:100%;"><div style="width:50%;"><div style="padding:0.5rem;position:relative;"><div style="font-size:1.5rem;"><a href=""><!--#-->hello hackernews<!--#--></a><a href="https://news.ycombinator.com/from?site=" style="color:gray;text-decoration:none;"><!--#--> ()<!--#--></a></div><div style="display:flex;flex-direction:row;color:gray;"><div><!--#-->0 points<!--#--></div><div style="padding-left:0.5rem;"><!--#-->by Author<!--#--></div><div style="padding-left:0.5rem;"><!--#-->10/16/23 3:59 PM<!--#--></div><div style="padding-left:0.5rem;"><!--#-->0 comments<!--#--></div></div></div></div><div style="width:50%;">Hover over a story to preview it here</div></div></div><blockquote><p>You can read more about Hooks in the <a href="../reference/hooks">Hooks reference</a></p></blockquote><h3 id="the-rules-of-hooks"><a class="header" href="#the-rules-of-hooks">The Rules of Hooks</a></h3><p>Hooks are a powerful way to manage state in Dioxus, but there are some rules you need to follow to insure they work as expected. Dioxus uses the order you call hooks to differentiate between hooks. Because the order you call hooks matters, you must follow these rules:</p><ol><li>Hooks may be only used in components or other hooks (we&#x27;ll get to that later)</li><li>On every call to the component function<ol><li>The same hooks must be called</li><li>In the same order</li></ol></li><li>Hooks name&#x27;s should start with use_ so you don&#x27;t accidentally confuse them with regular functions</li></ol><p>These rules mean that there are certain things you can&#x27;t do with hooks:</p><h4 id="no-hooks-in-conditionals"><a class="header" href="#no-hooks-in-conditionals">No Hooks in Conditionals</a></h4><div style="position: relative;"><div><pre style="background-color:#2b303b;">
</div><button style="position: absolute; top: 0; right: 0; background: rgba(0, 0, 0, 0.75); color: white; border: 1px solid white; padding: 0.25em;" onclick="navigator.clipboard.writeText(this.previousElementSibling.innerText)">Copy</button></div><div class="bg-white rounded-md shadow-md p-4 my-4 overflow-scroll text-black dioxus-demo" style="max-height:50vh;"><style>.dioxus-demo div { all: revert; }.dioxus-demo input { all: revert; }.dioxus-demo form { all: revert; }</style><div style="display:flex;flex-direction:row;width:100%;"><div style="width:50%;"><div style="padding:0.5rem;position:relative;"><div style="font-size:1.5rem;"><a href=""><!--#-->hello hackernews<!--#--></a><a href="https://news.ycombinator.com/from?site=" style="color:gray;text-decoration:none;"><!--#--> ()<!--#--></a></div><div style="display:flex;flex-direction:row;color:gray;"><div><!--#-->0 points<!--#--></div><div style="padding-left:0.5rem;"><!--#-->by Author<!--#--></div><div style="padding-left:0.5rem;"><!--#-->10/24/23 6:09 PM<!--#--></div><div style="padding-left:0.5rem;"><!--#-->0 comments<!--#--></div></div></div></div><div style="width:50%;">Hover over a story to preview it here</div></div></div><blockquote><p>You can read more about Hooks in the <a href="../reference/hooks">Hooks reference</a></p></blockquote><h3 id="the-rules-of-hooks"><a class="header" href="#the-rules-of-hooks">The Rules of Hooks</a></h3><p>Hooks are a powerful way to manage state in Dioxus, but there are some rules you need to follow to insure they work as expected. Dioxus uses the order you call hooks to differentiate between hooks. Because the order you call hooks matters, you must follow these rules:</p><ol><li>Hooks may be only used in components or other hooks (we&#x27;ll get to that later)</li><li>On every call to the component function<ol><li>The same hooks must be called</li><li>In the same order</li></ol></li><li>Hooks name&#x27;s should start with use_ so you don&#x27;t accidentally confuse them with regular functions</li></ol><p>These rules mean that there are certain things you can&#x27;t do with hooks:</p><h4 id="no-hooks-in-conditionals"><a class="header" href="#no-hooks-in-conditionals">No Hooks in Conditionals</a></h4><div style="position: relative;"><div><pre style="background-color:#2b303b;">
<span style="color:#65737e;">// ❌ don&#39;t call hooks in conditionals!
</span><span style="color:#65737e;">// We must ensure that the same hooks will be called every time
</span><span style="color:#65737e;">// But `if` statements only run if the conditional is true!
Expand Down
Loading

0 comments on commit aaf691a

Please sign in to comment.