swup / fragment-plugin

A swup plugin for dynamically replacing containers based on rules 🧩
https://swup-fragment-plugin.netlify.app
MIT License
15 stars 1 forks source link

feat: `rule.if` #77

Closed hirasso closed 3 months ago

hirasso commented 3 months ago

Description

It's time! For a current project I finally need rule.if. This is a rewrite of #47

Questions

Drive-By

Checks

github-actions[bot] commented 3 months ago

Playwright test results

passed  12 passed

Details

stats  12 tests across 1 suite
duration  
commit  d973886

daun commented 3 months ago

Yeah, been looking forward to this 🥯 Calling it if makes more sense to me than predicate, in terms of readability. Loose boolean matching is probably also fine -- as long as ommitting the if function is equivalent to () => true.

hirasso commented 3 months ago

as long as ommitting the if function is equivalent to () => true

Yes, it is. ok great!