Questions tagged [alt.js]

A library for managing data within JavaScript applications.

A library for managing data within JavaScript applications. http://alt.js.org

28 questions
3
votes
1 answer

react, react-router, and async data loading

I'm using react, alt.js, and react-router, and building an application with basic CRUD. There is a menu item for "Create Item", and it brings up a modal (using react-bootstrap...) and on submit it fires an action to create some model on the backend,…
Kevin
  • 24,871
  • 19
  • 102
  • 158
2
votes
1 answer

How do I get the type of a generic parameter in Typescript?

I have this Flux Store class: 'use strict'; import flux = require('app/tools/flux'); import types = require('app/tools/types'); import Actions = require('app/actions/actions'); class Store { bindListeners(config : any) : void {;}; books :…
Richard
  • 14,798
  • 21
  • 70
  • 103
2
votes
3 answers

React + Alt: Lifecycle Gap

Edit: Check out the git repository for a minmal example: https://github.com/maximilianschmitt/blind-lifecycle I have a component RequireUser that tries to ensure that the user is logged in and will otherwise not render its children. Its parent…
wundermax
  • 23
  • 3
1
vote
0 answers

Having trouble accessing React actions in isomorphic application

Iam using Alt.js with React and getting error in HomeActions.js file HomeActions.js: Uncaught TypeError: Cannot read property 'updateUserSuccess' of undefined. Not to mention the same code was working flawlessly before i completely reinstalled…
xtabbas
  • 627
  • 4
  • 10
  • 18
1
vote
1 answer

When to use dispatch with alt.js flux

I'm new to using flux and have started using the alt.js implmentation. I'm wondering when I would use dispatch from within my actions. For example, take this code. //ImageActions.js class ImageActions { getImages(id) { return…
ceckenrode
  • 4,543
  • 7
  • 28
  • 48
1
vote
1 answer

Reactjs/Flux/altjs Listen for Store Changes slow down app

i need to update Store on every button click on listView and change button state icon accordingly. unfollowing_ids is an array. componentWillMount: function() { FollowingStore.listen(this.onChange); }, componentWillUnmount: function()…
Waleed Arshad
  • 1,081
  • 3
  • 12
  • 24
1
vote
4 answers

How much state does really belong in the stores?

I was wondering, how much state does really belong into the stores, and not into the components? I've read at some places that really all state should live inside the stores. Would that include really component specific stuff, like input values…
MoeSattler
  • 6,684
  • 6
  • 24
  • 44
1
vote
0 answers

How to handle data dependencies with Async in Alt.js

I am currently trying to manage data dependencies in a react app. Usually I would just use waitFor. That doesnt help here though, since it won't wait for the async data fetching, just for the sync…
MoeSattler
  • 6,684
  • 6
  • 24
  • 44
1
vote
1 answer

Setting JS Alt Store State For Testing Purposes

I want to test my store - check that the store's data changes correctly after an action. I'm not able to change the state of the store that the action through the alt.dispatcher is connected to. The alt store test method doesn't work for me - I…
ohadwkn
  • 151
  • 1
  • 6
1
vote
1 answer

Alt actions not triggering alt store methods when dispatched (Flux)

I've recently started rewriting a flux & react app using alt.js which allows me easily bootstrap the application with data when rendering from the server. Everything else works great apart from the fact that I cannot get my store methods to fire…
MunkyMead
  • 355
  • 3
  • 9
1
vote
1 answer

JavaScript es6 call static function from another class

Here is the class with the static function import alt from '../alt'; import Parse from 'parse'; import { ElementTypes } from '../constants/ElementTypes'; class BoardActions { static getDefaultElement(x, y) { var Element =…
zeiteisen
  • 7,078
  • 5
  • 50
  • 68
1
vote
1 answer

Alt + React - invalid action reference while following alt tutorial

I'm trying to implement Alt in my React app. Currently I'm checking it out and just tried some thing following the tutorial. Now I'm stuck with the problem that the store does not recognizes the action. This is the action class: import alt from…
Michiel
  • 1,061
  • 10
  • 17
1
vote
0 answers

How to avoid losing React component methods when using Alt.js's connectToStores?

I'm using Alt.js's connectToStores to access store state inside a component, but when I try to call this component's method from aother component (using a ref), the method seems to be lost because of a wrapper component (gives undefined…
WoLfulus
  • 1,948
  • 1
  • 14
  • 21
1
vote
1 answer

TS2339: Property does not exist on type {}

Please help me fix this compilation error. Below you can see the compiler complaining that the Actions object on line 20 (I removed a few lines for clarity before posting this) is {}: But below you can see in actions.ts that Actions is an object…
Richard
  • 14,798
  • 21
  • 70
  • 103
0
votes
1 answer

Is calling another action in store listener an anti-pattern for Flux?

In my codebase, I fire action(s) inside some store listeners. However, I've heard recently that this is a bad practice. Why is it bad and how should I fix or refactor it? I've done research on this issue but wasn't able to find a good example. FYI,…
user1885433
  • 313
  • 5
  • 13
1
2