class DeclarativeActionsClass {
constructor() {
for (const key of Object.getOwnPropertyNames(this)) {
if(this[key] !== undefined) {
if(this[key].isActionRequiringBinding === true) {
this[key] = this[key].bind(this)
}
}
}
}
}
export function PassthroughAction(arity=null) {
function generatedAction() {
if (arity !== null) {
const numArguments = this.arguments.length
invariant(numArguments === arity, `Action with arity ${arity} was passed ${numArguments} parameters`)
}
return this.arguments
}
generatedAction.isActionRequiringBinding = true
return generatedAction
}
export function IgnorePayloads() {
/* This function ignores any parameters its given. Useful for passing an action as a React Native callback, then
* ignoring the event itself. It's empty because it always returns undefined. */
}
IgnorePayloads.isActionRequiringBinding = true
IgnorePayloads action and define a function callBoth that returns a function that calls the two functions its passed, with arguments. onPress={callBoth(d.pressStartNewCapture, this.setupNextAnimation)} will then work. IgnorePayloads is necessary here event callbacks receive an event as a parameter, and React re-uses events, so if you hold a reference to an event, your code won't work. This seemed like a mistake many beginners might make, and here is my declarative solution.
Projects in development include a new framework for building apps more quickly (using React, Alt-Flux, and Material-UI)
SubFire Radio is just my own system. - it works on the rules, the 'generators', you configure it with. It has reference to the subsonic access (API) to last.fm info for 'similar artists' but that's the closest to external it integrates with. All the app does is configure the rules and generate playlists (which store those rules in json as comments), and then my subfire players can run those generators at runtime to create a unique play queue on demand.
i looked at alt-ng but the changes in direction don't impress me. i'm comfortable with what i have.
the framework is "subfirebase" - it has browser for bookmarks, radio playlists, regular playlists, folders/files, and artists/albums, and a loading component that loads the items as you pick them (All through react-router). then each player just has to create its framing and its player - so i have a dashboard app that is landscape mode, and simpler (no support for file/folder/artist/album browsing -- too distracting in a car), and a full portrait mode mobile player (the replacement for the chrome extension version). The framework took about 9 months, and is itself a standalone web app/PWA...it just doesn't look 'great' because that wasn't the goal. it was a proof of concept for each feature/button...then the players can pick which of those buttons/features they want to support and where they go. the all-in-one approach I tried the first time, where the same app works on a phone and works on a TV, just doesn't really scale right - it is imperfect in both and that wasn't where i wanted it to be.
I have no need for native. PWA is fine by me. I have no need to 'compete' in the webstores with the multiple Android and IOS apps already there. The only exception is the amazon store for FireOS devices (TV and Tablet), the new TV version is still a work in progress (trying to get closer to the Android TV layout specification).
hi i want add new makeSelector add to project but this err TypeError: Cannot read property 'toJS' of undefined
(anonymous function)
src/store/ducks/inventories/selectors.js:26
23 |
24 | export const makeSelectProcurements = createSelector(
25 | selectProcurements,
26 | (substate) => substate.toJS(),
27 | );
28 |
29 |
TypeError: Class constructor xxxStore cannot be invoked without 'new'. Running the code itself is fine, not sure if everyone has any idea?
So I'm upgrading from 0.17.8 to latest, and it seems like alt.js used to support dispatching actions that didn't return anything?
elementSyncComplete() {
this.dispatch();
}
Now following through the migration guide where this.dispatch calls are replaced by return
So now I have:
elementSyncComplete() {
return;
}
But this does not work now, the action does not get dispatched. What's the recommended approach for this?