Aurelia 1.x Q&A - Sandbox at https://codesandbox.io/s/aurelia-javascript-sandbox-jnl6q85zq5
bigopon on 4.0.3
bigopon on master
chore(release): prepare release… (compare)
bigopon on 4.0.2
bigopon on master
chore(release): prepare release… (compare)
switchMap
in store.pipe
for the Aurelia Store App? I'm getting a funky ts violation:Argument of type 'OperatorFunction<QuickstartState, IQuickstartWorkspaceState>' is not assignable to parameter of type
'string | Reducer<QuickstartState, [OperatorFunction<QuickStartWorkspaceState, QuickStartWorkspaceState>, OperatorFunction<...>]>'.
{
"compileOnSave": false,
"compilerOptions": {
"target": "es2017",
"module": "esnext",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"sourceMap": true,
"allowJs": true,
"baseUrl": "src",
"skipLibCheck": true,
"lib": [
"es2017", "dom", "es2018.promise"
],
"noUnusedLocals": true,
"paths": {
"*" : ["*", "typings/*"],
},
},
"include": [
"src/**/*"
],
"exclude": [
"./bundles/**/*",
"./node_modules/**/*",
"dist",
"build",
"doc",
"test",
"config.js",
"gulpfile.js",
"karma.conf.js",
"bundles",
"lib"
]
}
mouseUpEventListener: EventListener = (e: MouseEvent) => { this.mouseCanvas_mouseUp(e); }
this.mouseCanvas.addEventListener('mouseup', this.mouseUpEventListener);
private mouseCanvas_mouseUp(e: MouseEvent) {
if (e.preventDefault) e.preventDefault();
if (e.stopPropagation) e.stopPropagation();
let lePointerEvent = <PointerEvent>{ offsetX: e.offsetX, offsetY: e.offsetY };
this.mouseCanvas_pointerUp(lePointerEvent);
}
Thanks @TonyLugg I was looking for a way to listen to manually dispatched events that aren’t necessarily bound to an element. So if the code has something like
window.dispatchEvent(new CustomEvent(‘dateChanged’,newDate));
I guess, based on your example, I can do
this.addEventListener(‘dateChanged’, this.dateChangedListener);
I just read the documentation regarding function references and I’m a bit confused about callbacks with parameters. Here’s my confusion:
In my parent view, I can have the following:
<my-custom-comp callback.call=“myParentFunction(paramA, paramB)” … >
1) I’m assuming that paramA and paramB are actually bindable fields, but are they of the parent or of the custom element?
2) If they are of the parent, how are they accessed in the custom element so that it can call callback({paramA: <first passed value>, paramB: <second passed value>})
3) If they are of the custom element, then I’m going to assume that I can make the call like callback({paramA: this.paramA, paramB: this.paramB})
4) How is myParentFunction defined in the parent? Like so?
myParentFunction(arbitraryParamNameA, arbitraryParamNameB)
Thanks!
Ok…so I searched through discourse and found this post —> https://discourse.aurelia.io/t/call-function-from-custom-element/1793
Which kinda answres my question. Thanks y’all! :-)
Hi all - this is a sort of Aurelia-related question. If you look inside a lot of node_modules
package folders - let's take aurelia-fetch-client
for example - in the dist
folder there are various targets, e.g. amd
, commonjs
, system
, 2015
, umd
, etc. My question is, how does a bundler e.g. webpack choose which one to load? Is it a webpack thing, or a tsconfig thing (I'm using TypeScript). I'm really hazy on which part of the toolchain is doing this.
My problem is I have a bundle that's broken in IE11. I can see that its contents includes code straight out of aurelia-pal-browser/dist/es2015
which IE is not going to handle very well.