Giter Club home page Giter Club logo

react-scax's People

Contributors

cadenguo avatar nightism avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

react-scax's Issues

[BUG]Type error in onFulfilment and onRejection

๐Ÿ› Describe the bug
onFulfilment/onRejection seems to able to intake 'any' type of input in TScaxerBatchConfiguration

๐ŸŒ Expected behavior
onFulfilment/onRejection should be configured to intake only callback or function type

[FEATURE]Additional scaxer state

๐Ÿคฉ Describe the solution you'd like
Add an additional scaxer state after scaxer.getData() to indicate that the data has been retrieved at lease once after fulfilled.

[BUG]PureComponent won't update when scaxer fulfills

๐Ÿ› Describe the bug
PureComponent is not updating or rerendering when a scaxer finish execution.

โ˜‚๏ธ Additional context
This is because in the current logic of SCAX, this.setState({}) is used to rerender a component.

However, since PureCompoent uses shallowCompare for state change, this.setState({}) will just not trigger a rerender.

[FEATURE]Enable inline onFulfillment/onRejection actions

๐Ÿ†˜ Is your feature request related to a problem? Please describe.
onFulfillment and onRejection can only be configured in TScaxerBatchConfiguration, which is not flexible enough.

This case hindered the development especially when more than scaxers to be called in different cases after fulfillment/rejection. Besides, since when configuring a scaxer to be a successor, a string will be passes in, thus there is no way to configure the input parameters.

๐Ÿคฉ Describe the solution you'd like

...
const myScaxer = pool.getScaxer('myscaxer')
...
myScaxer.call({}).onFulfillment(() => { ... })
// or alternatively
myScaxer.call(
    {}, // parameters
    () => { ... }, // onFulfillment
    () => { ... }, // onRejection

[ENHANCEMENT] Scaxer Call function must be passed with a parameter while using typescript

**๐Ÿฅบ Something to improve **
When TParamType is not specified in TScaxerBatchConfiguration, scaxer.call() still must be passed with a parameter (of any types). This is because TParamType will be interpreted as the unknown type in this case.

**๐Ÿ˜Œ Any suggestions? **
When TParamType is not specified, scaxer.call() can be called directly without any parameters.

[BUG]Type of parameters must be specified in typescirpt

๐Ÿ› Describe the bug
Type of parameters must be specified when using AJAX_JSON_TEMPLATE.
Creating a scaxer without passing in a TParamType will lead to a type-incompatible-error.

๐ŸŒ Expected behavior
A scaxer can be created without passing in a TParamType if there are no parameters needed.

[FEATURE]Attach gives options to intake pool and scaxer object directly

๐Ÿคฉ Describe the solution you'd like
enable attach(poolObject, [scaxerObject1, scaxerObject2])(MyComponent)

๐Ÿค“ Describe alternatives you've considered
The following scenario is a very common case, which is redundent:

...
import { pool, AUTH_INFO_SCAXER_NAME } from '../scaxer'
const authInfoScaxer = pool.getScaxer(AUTH_INFO_SCAXER_NAME)
...
class MyComponent extends React.Component { ... }
...
export default attach(pool.getName(), [AUTH_INFO_SCAXER_NAME])(MyComponent)

[ENHANCEMENT] Logic enhancement for attach method

๐Ÿฅบ Something to improve

...
let Component: any;
if (isAttachedComponentClass) {
    Component = component;
} else if (isAttachedComponentWrapper) {
    /**
     * TODO: This if branch does that same as the previous one.
     * May need to implements more provessing for wrapper components.
     */
    Component = component;
} else { // If passed-in component is a user defined function component
    Component = class extends React.Component<React.ComponentProps<C>> {
        render() {
            return (component as any)(this.props);
        }
    };
    Component.displayName = displayName;
}
...

๐Ÿ˜Œ Any suggestions?
As commented.

[BUG]Scaxer call in componentDidMount lead to unexpected behaviors

โ˜‚๏ธ Additional context
Calling saxer.call() in componentDidMount will trigger setState() being called, which is an anti-pattern for react development.

Currently, our team seemed to solve it by using componentWillMount in the wrapper component, which is also not a recommended workaround. Since this function is soon to be renamed as announced by React.

Further investigation is needed for this issue.

[FEATURE]Cancel a scaxer call

๐Ÿคฉ Describe the solution you'd like
Manually cancel a scaxer call.
i.e. myScaxer.cancel() // will terminate the current scaxer call if any

๐Ÿค“ Describe alternatives you've considered
Current ScaxerBlocking options can be an alternative to this feature.

[BUG]SCAXER.BlOCKING options are not exported

๐Ÿ› Describe the bug
SCAXER.BlOCKING options are not exported, and it is unable to modify blocking options in typescript.

๐ŸŒ Expected behavior
SCAXER.BlOCKING options are exported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.