Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean data between path changes #2

Open
bedeoverend opened this issue Jun 22, 2017 · 4 comments
Open

Clean data between path changes #2

bedeoverend opened this issue Jun 22, 2017 · 4 comments
Assignees
Labels

Comments

@bedeoverend
Copy link
Contributor

Say an element has path with content, say /post/1, and loads this content in, then the path changes to a new (empty) path: /post/2 - there is no content and the buffer is clean, so this will load the 'static' content, which is actually the old content set from /post/1.

Should we purge the contents of the element before loading in /post/1? Should we have smarter 'static content' loading? e.g. know when it's static and set by dev, know when its been input by user, know when it's been loaded by the behavior itself and not changed.

@bedeoverend bedeoverend self-assigned this Jun 22, 2017
@bedeoverend
Copy link
Contributor Author

cc @seaneking

@madeleineostoja
Copy link

👍 Yes. Remember discussing this previously, and thought it was fixed in Simpla 2. Setting a path should always set the content of that path, if that content is null then it should be empty.

Static content is a separate case - the change from undefined to /some/path. If /some/path doesn't have data, the element should show nothing. If someone sets the path back to undefined, it should show static content (though that's a pointless use-case, so wouldn't worry about actually supporting it, just demonstrating the logic)

@bedeoverend
Copy link
Contributor Author

Yup agree - the problem is around implementation, but I agree on the logic 👍

@madeleineostoja
Copy link

Cool. Because yeah also keep in mind that static content is only for dev, we recommend strongly not using it in prod. So it doesn't need to be robust, just a way to initialise content for an element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants