feat($resource): Add optional constructor to factored resources

So we can specified the custom constructor.

Related: #1483.