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

Add a new method called pop() #166

Open
igorissen opened this issue Feb 1, 2024 · 1 comment
Open

Add a new method called pop() #166

igorissen opened this issue Feb 1, 2024 · 1 comment
Labels
feature New functionality or improvement

Comments

@igorissen
Copy link

igorissen commented Feb 1, 2024

Runtime

nodejs

Runtime version

20.10.0

Module version

11.0.1

Used with

hapi

Any other relevant information

No response

What problem are you trying to solve?

Currently, my colleagues and I are using your plugin on this project Pix, and we've noticed that the use of the method get() isn't clear, especially when someone unfamiliar with the plugin sees this line request.yar.get('key', true);.

It's not clear what the value true means. For that we need to go to the documentation page. It will be great to use something like pop('key').

We think that as JavaScript developers we will somehow see more frequently this method pop used with arrays.

Do you have a new or modified API suggestion to solve the problem?

This method pop() will have an argument which is the key and will removes the key if it is available in the store.
If the key does not exist, it will return null as value.

I have created a PR #167

@igorissen igorissen added the feature New functionality or improvement label Feb 1, 2024
@joaomarcosjova

This comment was marked as spam.

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

No branches or pull requests

2 participants