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

Added getTemplates function to MemoryLoader #660

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

ydcode
Copy link
Contributor

@ydcode ydcode commented Sep 29, 2023

Summary
This Pull Request adds a new method getTemplates() to the MemoryLoader class. The method is designed to return a list of all the existing templates currently loaded in memory.

Background
In applications that dynamically generate or update Pebble templates, it is often necessary to get a list of all existing templates. However, the MemoryLoader class lacks a method for obtaining this information, which could lead to inefficiencies and limitations in application development.

Changes
Added a new method getTemplates() in MemoryLoader class.
Updated relevant unit tests (if applicable).

Use Case
This feature will be useful in scenarios where developers need to:

Debug or log currently loaded templates.
Implement functionality that depends on the list of loaded templates.

Making the inner class TemplateDefinition public to allow external access for specific use-cases.
@ebussieres ebussieres added this to the 3.2.2 milestone Nov 27, 2023
@ebussieres ebussieres merged commit c5fa796 into PebbleTemplates:master Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants