martyjs / marty

A Javascript library for state management in React applications
http://martyjs.org
MIT License
1.09k stars 77 forks source link

Output from pending state is not removed at the end of the request #305

Closed yani- closed 9 years ago

yani- commented 9 years ago

In the following sample, the output from pending state stays on the page after the request is complete - done state has been reached. expected output:

<div>file</div>

actual output:

<div>file</div>
<div>loading</div>
var File = React.createClass({
    render: function () {
        return (
            <div>{this.props.file}</div>
        );
    }
});

module.exports = Marty.createContainer(File, {
    listenTo: [FileStore],
    fetch: {
        file: function () {
            return FileStore.for(this).getFile();
        }
    },
    pending: function () {
        return (
            <div>loading</div>
        );
    },
    failed: function (error) {
        return <div>{error}</div>;
    }
});
jhollingworth commented 9 years ago

Looking into this, will get back to you asap

jhollingworth commented 9 years ago

Sorry for the delay in getting to this. I've just tried to replicate but can't. What version of Marty are you using?

taion commented 9 years ago

Closing due to inactivity.