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

Promise Data Array is not in a Correct Order. #5

Open
16amattice opened this issue Nov 30, 2023 · 0 comments
Open

Promise Data Array is not in a Correct Order. #5

16amattice opened this issue Nov 30, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@16amattice
Copy link

This is pulled from hoodiehq#859, originally posted by @ronaldaug

Is there any query or method that I can get the correct order of array?
If I add an item, it should store as the last item in the array. But it's not working like that. ( Probably, it's only happen at me? )

Currently, I have to reorder the array by sorting the times like this

hoodie.store.findAll().then(function (data) {
	data.sort((a,b)=>return b.createdAt - a.createdAt);
})

And one more question how do I get current username/data?
I try something like this and it just return promise.

var currentUsername = hoodie.account.get().then(function(e){
        return e.username;
})

console.log(currentUsername);
Is there any easy way to get username as a string?
Probably something like this var currentUsername = hoddie.account.get('username');

@16amattice 16amattice added the enhancement New feature or request label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant